projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
13063: Use upstream azure-sdk-for-go.
[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..adb620ea8d34778f9d3c4d32edd42f518867b5a4 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"
@@
-23,18
+22,13
@@
type jobPriority struct {
// command 'squeue'.
type SqueueChecker struct {
Period time.Duration
// command 'squeue'.
type SqueueChecker struct {
Period time.Duration
+ Slurm Slurm
uuids map[string]jobPriority
startOnce sync.Once
done chan struct{}
sync.Cond
}
uuids map[string]jobPriority
startOnce sync.Once
done chan struct{}
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
+78,7
@@
func (sqc *SqueueChecker) check() {
sqc.L.Lock()
defer sqc.L.Unlock()
sqc.L.Lock()
defer sqc.L.Unlock()
- cmd := sq
ueueCmd(
)
+ cmd := sq
c.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 {