From: Tom Clegg Date: Thu, 18 Jan 2018 21:41:39 +0000 (-0500) Subject: 12891: Avoid flapping finalState after cancel. X-Git-Tag: 1.1.3~15^2~4 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/a63829d71b904ead17aeac3c68bf01e9b020a3a1 12891: Avoid flapping finalState after cancel. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go index a78d47d480..45e48c2b8a 100644 --- a/services/crunch-run/crunchrun.go +++ b/services/crunch-run/crunchrun.go @@ -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