18346: Only disable websockets when all container mounts are by PDH
[arvados.git] / lib / crunchrun / crunchrun.go
index 9f3edd0b942b6f5fbd894cc7a0379c632e7d794a..33558b5d9b9135000e6d51ba13e8660cdea608f3 100644 (file)
@@ -415,7 +415,6 @@ func (runner *ContainerRunner) SetupMounts() (map[string]bindmount, error) {
                "arv-mount",
                "--foreground",
                "--read-write",
-               "--disable-event-listening",
                "--storage-classes", strings.Join(runner.Container.OutputStorageClasses, ","),
                fmt.Sprintf("--crunchstat-interval=%v", runner.statInterval.Seconds())}
 
@@ -618,10 +617,15 @@ func (runner *ContainerRunner) SetupMounts() (map[string]bindmount, error) {
        }
 
        if pdhOnly {
-               arvMountCmd = append(arvMountCmd, "--mount-by-pdh", "by_id")
+               // If we are only mounting collections by pdh, make
+               // sure we don't subscribe to websocket events to
+               // avoid putting undesired load on the API server
+               arvMountCmd = append(arvMountCmd, "--mount-by-pdh", "by_id", "--disable-event-listening")
        } else {
                arvMountCmd = append(arvMountCmd, "--mount-by-id", "by_id")
        }
+       // the by_uuid mount point is used by singularity when writing
+       // out docker images converted to SIF
        arvMountCmd = append(arvMountCmd, "--mount-by-id", "by_uuid")
        arvMountCmd = append(arvMountCmd, runner.ArvMountPoint)