projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
12891: Don't use SIGKILL when telling crunch-run to cancel.
[arvados.git]
/
services
/
crunch-dispatch-slurm
/
squeue.go
diff --git
a/services/crunch-dispatch-slurm/squeue.go
b/services/crunch-dispatch-slurm/squeue.go
index 819c2d2510f992ab75c18249d8b46d6c13828d6d..5ecfe8ff2fc049201eb27c8e58c7a02eb84cbbb4 100644
(file)
--- a/
services/crunch-dispatch-slurm/squeue.go
+++ b/
services/crunch-dispatch-slurm/squeue.go
@@
-8,7
+8,6
@@
import (
"bytes"
"fmt"
"log"
"bytes"
"fmt"
"log"
- "os/exec"
"strings"
"sync"
"time"
"strings"
"sync"
"time"
@@
-29,12
+28,6
@@
type SqueueChecker struct {
sync.Cond
}
sync.Cond
}
-func squeueFunc() *exec.Cmd {
- return exec.Command("squeue", "--all", "--format=%j %y %Q")
-}
-
-var squeueCmd = squeueFunc
-
// HasUUID checks if a given container UUID is in the slurm queue.
// This does not run squeue directly, but instead blocks until woken
// up by next successful update of squeue.
// HasUUID checks if a given container UUID is in the slurm queue.
// This does not run squeue directly, but instead blocks until woken
// up by next successful update of squeue.
@@
-84,7
+77,7
@@
func (sqc *SqueueChecker) check() {
sqc.L.Lock()
defer sqc.L.Unlock()
sqc.L.Lock()
defer sqc.L.Unlock()
- cmd :=
squeueCmd(
)
+ cmd :=
theConfig.slurm.QueueCommand([]string{"--all", "--format=%j %y %Q"}
)
stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{}
cmd.Stdout, cmd.Stderr = stdout, stderr
if err := cmd.Run(); err != nil {
stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{}
cmd.Stdout, cmd.Stderr = stdout, stderr
if err := cmd.Run(); err != nil {