[ARVADOS] created: 1ffb5894a28bc2744d3631d8fbc66b646e42e602
Git user
git at public.curoverse.com
Thu Dec 1 12:56:24 EST 2016
at 1ffb5894a28bc2744d3631d8fbc66b646e42e602 (commit)
commit 1ffb5894a28bc2744d3631d8fbc66b646e42e602
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Dec 1 12:56:17 2016 -0500
10649: Make errors emitted by squeue and scancel show up in logs.
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index 3c4f281..ab2cf40 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -302,7 +302,10 @@ func run(dispatcher *dispatch.Dispatcher,
// Mutex between squeue sync and running sbatch or scancel.
squeueUpdater.SlurmLock.Lock()
- err := scancelCmd(container).Run()
+ cmd := scancelCmd(container)
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ err := cmd.Run()
squeueUpdater.SlurmLock.Unlock()
if err != nil {
diff --git a/services/crunch-dispatch-slurm/squeue.go b/services/crunch-dispatch-slurm/squeue.go
index 61decde..4b1a3ca 100644
--- a/services/crunch-dispatch-slurm/squeue.go
+++ b/services/crunch-dispatch-slurm/squeue.go
@@ -3,6 +3,7 @@ package main
import (
"bufio"
"log"
+ "os"
"os/exec"
"sync"
"time"
@@ -40,6 +41,7 @@ func (squeue *Squeue) RunSqueue() {
// Also ensure unlock on all return paths
cmd := squeueCmd()
+ cmd.Stderr = os.Stderr
sq, err := cmd.StdoutPipe()
if err != nil {
log.Printf("Error creating stdout pipe for squeue: %v", err)
@@ -62,7 +64,7 @@ func (squeue *Squeue) RunSqueue() {
err = cmd.Wait()
if err != nil {
- log.Printf("Error running squeue: %v", err)
+ log.Printf("Error running squeue: %v (stdout was: %v)", err, newSqueueContents)
return
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list