[ARVADOS] created: 1.1.1-265-g0c835b7

Git user git at public.curoverse.com
Fri Dec 15 19:14:32 EST 2017


        at  0c835b7d7710ef6ecb08c2d54802951f137f0cb2 (commit)


commit 0c835b7d7710ef6ecb08c2d54802951f137f0cb2
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Fri Dec 15 19:13:24 2017 -0500

    12821: Fix race in concurrent calls to submit().
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index 3d094c7..3c89103 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -222,7 +222,12 @@ func submit(dispatcher *dispatch.Dispatcher, container arvados.Container, crunch
 
 	// Send a tiny script on stdin to execute the crunch-run
 	// command (slurm requires this to be a #! script)
-	cmd.Stdin = strings.NewReader(execScript(append(crunchRunCommand, container.UUID)))
+
+	// append() here avoids modifying crunchRunCommand's
+	// underlying array, which is shared with other goroutines.
+	args := append([]string(nil), crunchRunCommand...)
+	args = append(args, container.UUID)
+	cmd.Stdin = strings.NewReader(execScript(args))
 
 	var stdout, stderr bytes.Buffer
 	cmd.Stdout = &stdout

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list