X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a7a482db3954fa6470be74f0e00f6e1e105e0b6c..70838209c214bfa57ef4bce289e1530a1cc2b081:/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go index 36bcef4f26..4115482d80 100644 --- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go +++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go @@ -280,7 +280,8 @@ func (disp *Dispatcher) runContainer(_ *dispatch.Dispatcher, ctr arvados.Contain cmd = append(cmd, disp.cluster.Containers.CrunchRunArgumentsList...) if err := disp.submit(ctr, cmd); err != nil { var text string - if err, ok := err.(dispatchcloud.ConstraintsNotSatisfiableError); ok { + switch err := err.(type) { + case dispatchcloud.ConstraintsNotSatisfiableError: var logBuf bytes.Buffer fmt.Fprintf(&logBuf, "cannot run container %s: %s\n", ctr.UUID, err) if len(err.AvailableTypes) == 0 { @@ -296,7 +297,7 @@ func (disp *Dispatcher) runContainer(_ *dispatch.Dispatcher, ctr arvados.Contain } text = logBuf.String() disp.UpdateState(ctr.UUID, dispatch.Cancelled) - } else { + default: text = fmt.Sprintf("Error submitting container %s to slurm: %s", ctr.UUID, err) } log.Print(text)