[ARVADOS] created: 3c4bcfbe8611878bff64778180f84ad93829e6b2

Git user git at public.curoverse.com
Wed Jun 8 11:25:01 EDT 2016


        at  3c4bcfbe8611878bff64778180f84ad93829e6b2 (commit)


commit 3c4bcfbe8611878bff64778180f84ad93829e6b2
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Jun 8 11:20:21 2016 -0400

    9187: If a container is reported Queued, but we are monitoring it, stop monitoring it.

diff --git a/sdk/go/dispatch/dispatch.go b/sdk/go/dispatch/dispatch.go
index fb7b5fb..9fe2e39 100644
--- a/sdk/go/dispatch/dispatch.go
+++ b/sdk/go/dispatch/dispatch.go
@@ -103,14 +103,16 @@ func (dispatcher *Dispatcher) notMine(uuid string) {
 }
 
 // Check if there is a channel for updates associated with this container.  If
-// so send the container record on the channel and return true, if not return
-// false.
-func (dispatcher *Dispatcher) updateMine(c Container) bool {
+// so (and update is true) send the container record on the channel and return
+// true, if not return false.
+func (dispatcher *Dispatcher) checkMine(c Container, update bool) bool {
 	dispatcher.mineMutex.Lock()
 	defer dispatcher.mineMutex.Unlock()
 	ch, ok := dispatcher.mineMap[c.UUID]
 	if ok {
-		ch <- c
+		if update {
+			ch <- c
+		}
 		return true
 	}
 	return false
@@ -174,6 +176,10 @@ func (dispatcher *Dispatcher) pollContainers() {
 }
 
 func (dispatcher *Dispatcher) handleUpdate(container Container) {
+	if container.State == Queued && dispatcher.checkMine(container, false) {
+		dispatcher.notMine(container.UUID)
+	}
+
 	if container.LockedByUUID != dispatcher.Auth.UUID && container.State != Queued {
 		// If container is Complete, Cancelled, or Queued, LockedByUUID
 		// will be nil.  If the container was formerly Locked, moved
@@ -185,7 +191,7 @@ func (dispatcher *Dispatcher) handleUpdate(container Container) {
 		return
 	}
 
-	if dispatcher.updateMine(container) {
+	if dispatcher.checkMine(container, true) {
 		// Already monitored, sent status update
 		return
 	}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list