12891: Avoid flapping finalState after cancel.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 18 Jan 2018 21:41:39 +0000 (16:41 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 22 Jan 2018 17:34:03 +0000 (12:34 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

services/crunch-run/crunchrun.go

index a78d47d480ae23deb9953ca96713d827ed57e2cd..45e48c2b8a4bb1b1713a899f5bd6bdbad5614c4e 100644 (file)
@@ -1139,10 +1139,6 @@ func (runner *ContainerRunner) UploadOutputFile(
 
 // HandleOutput sets the output, unmounts the FUSE mount, and deletes temporary directories
 func (runner *ContainerRunner) CaptureOutput() error {
-       if runner.finalState != "Complete" {
-               return nil
-       }
-
        if wantAPI := runner.Container.RuntimeConstraints.API; wantAPI != nil && *wantAPI {
                // Output may have been set directly by the container, so
                // refresh the container record to check.
@@ -1595,7 +1591,7 @@ func (runner *ContainerRunner) Run() (err error) {
        }
 
        err = runner.WaitFinish()
-       if err == nil {
+       if err == nil && !runner.IsCancelled() {
                runner.finalState = "Complete"
        }
        return