X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/007d2919fc56632bc957d90378ed7a5d3b14aa3c..cd0e7f06116925d66cc370a03cef1b8c19d0002d:/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 cca8b3f150..30cbb79dc1 100644 --- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go +++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main // Dispatcher service for Crunch that submits containers to the slurm queue. @@ -226,13 +230,21 @@ func run(disp *dispatch.Dispatcher, ctr arvados.Container, status <-chan arvados if ctr.State == dispatch.Locked && !sqCheck.HasUUID(ctr.UUID) { log.Printf("Submitting container %s to slurm", ctr.UUID) if err := submit(disp, ctr, theConfig.CrunchRunCommand); err != nil { - log.Printf("Error submitting container %s to slurm: %s", ctr.UUID, err) + text := fmt.Sprintf("Error submitting container %s to slurm: %s", ctr.UUID, err) + log.Print(text) + + lr := arvadosclient.Dict{"log": arvadosclient.Dict{ + "object_uuid": ctr.UUID, + "event_type": "dispatch", + "properties": map[string]string{"text": text}}} + disp.Arv.Create("logs", lr, nil) + disp.Unlock(ctr.UUID) return } } - log.Printf("Start monitoring container %s", ctr.UUID) + log.Printf("Start monitoring container %v in state %q", ctr.UUID, ctr.State) defer log.Printf("Done monitoring container %s", ctr.UUID) // If the container disappears from the slurm queue, there is