[ARVADOS] updated: 1.3.0-2056-g3c848757e

Git user git at public.arvados.org
Wed Jan 8 20:01:23 UTC 2020


Summary of changes:
 lib/dispatchcloud/container/queue.go      | 8 ++------
 lib/dispatchcloud/container/queue_test.go | 3 ++-
 2 files changed, 4 insertions(+), 7 deletions(-)

       via  3c848757efb9b1697962cb51068c87658565908b (commit)
      from  9d79488376e90532512733748eed1aa78af1c125 (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 3c848757efb9b1697962cb51068c87658565908b
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Wed Jan 8 14:53:20 2020 -0500

    15942: Fix race in test case.
    
    When each call to Update from the test case was starting its own
    lock-update-cancel goroutine, some of these would still be
    running (and attempting to cancel the container) after the test case
    had succeeded and called /database/reset -- and thus cause a different
    test case to fail.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/dispatchcloud/container/queue.go b/lib/dispatchcloud/container/queue.go
index 21b41ec4d..a4a270dd1 100644
--- a/lib/dispatchcloud/container/queue.go
+++ b/lib/dispatchcloud/container/queue.go
@@ -240,19 +240,15 @@ func (cq *Queue) addEnt(uuid string, ctr arvados.Container) {
 		go func() {
 			if ctr.State == arvados.ContainerStateQueued {
 				// Can't set runtime error without
-				// locking first. If Lock() is
-				// successful, it will call addEnt()
-				// again itself, and we'll fall
-				// through to the
-				// setRuntimeError/Cancel code below.
+				// locking first.
 				err := cq.Lock(ctr.UUID)
 				if err != nil {
 					logger.WithError(err).Warn("lock failed")
+					return
 					// ...and try again on the
 					// next Update, if the problem
 					// still exists.
 				}
-				return
 			}
 			var err error
 			defer func() {
diff --git a/lib/dispatchcloud/container/queue_test.go b/lib/dispatchcloud/container/queue_test.go
index bb8226118..31f321488 100644
--- a/lib/dispatchcloud/container/queue_test.go
+++ b/lib/dispatchcloud/container/queue_test.go
@@ -134,10 +134,11 @@ func (suite *IntegrationSuite) TestCancelIfNoInstanceType(c *check.C) {
 	c.Check(err, check.IsNil)
 	c.Check(ctr.State, check.Equals, arvados.ContainerStateQueued)
 
+	go cq.Update()
+
 	// Wait for the cancel operation to take effect. Container
 	// will have state=Cancelled or just disappear from the queue.
 	suite.waitfor(c, time.Second, func() bool {
-		cq.Update()
 		err := client.RequestAndDecode(&ctr, "GET", "arvados/v1/containers/"+arvadostest.QueuedContainerUUID, nil, nil)
 		return err == nil && ctr.State == arvados.ContainerStateCancelled
 	})

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list