From: Peter Amstutz Date: Fri, 29 Mar 2019 20:27:04 +0000 (-0400) Subject: 15050: After waking up, check if the container was cancelled X-Git-Tag: 1.4.0~86^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/451183bfac95afc747a662fe98a3d52899dcdc53 15050: After waking up, check if the container was cancelled Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/services/crunch-dispatch-local/crunch-dispatch-local.go b/services/crunch-dispatch-local/crunch-dispatch-local.go index 62935447dd..ae09c52f21 100644 --- a/services/crunch-dispatch-local/crunch-dispatch-local.go +++ b/services/crunch-dispatch-local/crunch-dispatch-local.go @@ -155,6 +155,17 @@ func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher, defer func() { <-lr.concurrencyLimit }() + select { + case c := <-status: + // Check for state updates after possibly + // waiting to be ready-to-run + if c.Priority == 0 { + goto Finish + } + default: + break + } + waitGroup.Add(1) defer waitGroup.Done() @@ -212,6 +223,8 @@ func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher, } } +Finish: + // If the container is not finalized, then change it to "Cancelled". err := dispatcher.Arv.Get("containers", uuid, nil, &container) if err != nil {