[ARVADOS] updated: 2.1.0-2301-g79ed8ab99

Git user git at public.arvados.org
Wed Apr 13 18:28:28 UTC 2022


Summary of changes:
 services/crunch-dispatch-local/crunch-dispatch-local.go      | 10 +++++-----
 services/crunch-dispatch-local/crunch-dispatch-local_test.go |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

       via  79ed8ab99bb2ad779c873620704519cf02177962 (commit)
      from  8953bb09c63894d79896a15c3b276136cdf4332b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 79ed8ab99bb2ad779c873620704519cf02177962
Author: Tom Clegg <tom at curii.com>
Date:   Wed Apr 13 14:27:52 2022 -0400

    18947: Fix panic in tests when TestIntegration doesn't run first.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/crunch-dispatch-local/crunch-dispatch-local.go b/services/crunch-dispatch-local/crunch-dispatch-local.go
index 968b556a2..c33c2358c 100644
--- a/services/crunch-dispatch-local/crunch-dispatch-local.go
+++ b/services/crunch-dispatch-local/crunch-dispatch-local.go
@@ -31,7 +31,7 @@ var (
 	runningCmds      map[string]*exec.Cmd
 	runningCmdsMutex sync.Mutex
 	waitGroup        sync.WaitGroup
-	crunchRunCommand *string
+	crunchRunCommand string
 )
 
 func main() {
@@ -50,7 +50,7 @@ func main() {
 		10,
 		"Interval in seconds to poll for queued containers")
 
-	crunchRunCommand = flags.String(
+	flags.StringVar(&crunchRunCommand,
 		"crunch-run-command",
 		"/usr/bin/crunch-run",
 		"Crunch command to run container")
@@ -198,7 +198,7 @@ func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher,
 		waitGroup.Add(1)
 		defer waitGroup.Done()
 
-		cmd := exec.Command(*crunchRunCommand, "--runtime-engine="+lr.cluster.Containers.RuntimeEngine, uuid)
+		cmd := exec.Command(crunchRunCommand, "--runtime-engine="+lr.cluster.Containers.RuntimeEngine, uuid)
 		cmd.Stdin = nil
 		cmd.Stderr = os.Stderr
 		cmd.Stdout = os.Stderr
@@ -211,7 +211,7 @@ func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher,
 		runningCmdsMutex.Lock()
 		if err := lr.startCmd(container, cmd); err != nil {
 			runningCmdsMutex.Unlock()
-			dispatcher.Logger.Warnf("error starting %q for %s: %s", *crunchRunCommand, uuid, err)
+			dispatcher.Logger.Warnf("error starting %q for %s: %s", crunchRunCommand, uuid, err)
 			dispatcher.UpdateState(uuid, dispatch.Cancelled)
 		} else {
 			runningCmds[uuid] = cmd
@@ -261,7 +261,7 @@ Finish:
 	}
 	if container.State == dispatch.Locked || container.State == dispatch.Running {
 		dispatcher.Logger.Warnf("after %q process termination, container state for %v is %q; updating it to %q",
-			*crunchRunCommand, uuid, container.State, dispatch.Cancelled)
+			crunchRunCommand, uuid, container.State, dispatch.Cancelled)
 		dispatcher.UpdateState(uuid, dispatch.Cancelled)
 	}
 
diff --git a/services/crunch-dispatch-local/crunch-dispatch-local_test.go b/services/crunch-dispatch-local/crunch-dispatch-local_test.go
index 5d6176b04..e5ce5c66c 100644
--- a/services/crunch-dispatch-local/crunch-dispatch-local_test.go
+++ b/services/crunch-dispatch-local/crunch-dispatch-local_test.go
@@ -64,7 +64,7 @@ func (s *TestSuite) TestIntegration(c *C) {
 	c.Assert(err, IsNil)
 
 	echo := "echo"
-	crunchRunCommand = &echo
+	crunchRunCommand = echo
 
 	ctx, cancel := context.WithCancel(ctxlog.Context(context.Background(), ctxlog.TestLogger(c)))
 	dispatcher := dispatch.Dispatcher{
@@ -169,7 +169,7 @@ func testWithServerStub(c *C, apiStubResponses map[string]arvadostest.StubRespon
 	logger := ctxlog.TestLogger(c)
 	logger.SetOutput(io.MultiWriter(buf, logger.Out))
 
-	*crunchRunCommand = crunchCmd
+	crunchRunCommand = crunchCmd
 
 	ctx, cancel := context.WithCancel(ctxlog.Context(context.Background(), logger))
 	defer cancel()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list