13558: Merge branch 'master' into wtsi-hgi-13558-debug-log-tag-req-id
[arvados.git] / services / crunch-run / crunchrun.go
index 4cbe7f9c9c299f0509a7266ce8541d64f5c75d79..0a980b9ce9359cde4529928e78eba06ac74644f3 100644 (file)
@@ -742,6 +742,7 @@ func (runner *ContainerRunner) startCrunchstat() error {
                CgroupParent: runner.expectCgroupParent,
                CgroupRoot:   runner.cgroupRoot,
                PollPeriod:   runner.statInterval,
+               TempDir:      runner.parentTemp,
        }
        runner.statReporter.Start()
        return nil
@@ -1122,9 +1123,7 @@ func (runner *ContainerRunner) WaitFinish() error {
        }
 
        containerdGone := make(chan error)
-       defer func() {
-               close(containerdGone)
-       }()
+       defer close(containerdGone)
        if runner.checkContainerd > 0 {
                go func() {
                        ticker := time.NewTicker(time.Duration(runner.checkContainerd))
@@ -1137,7 +1136,8 @@ func (runner *ContainerRunner) WaitFinish() error {
                                                return
                                        }
                                case <-containerdGone:
-                                       break
+                                       // Channel closed, quit goroutine
+                                       return
                                }
                        }
                }()