[ARVADOS] created: 2c4ff054b533c62ecdb269963d3ab0af20d2df8b

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


        at  2c4ff054b533c62ecdb269963d3ab0af20d2df8b (commit)


commit 2c4ff054b533c62ecdb269963d3ab0af20d2df8b
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Jun 8 11:46:12 2016 -0400

    9187: Don't try to take lock on containers with priority 0.

diff --git a/sdk/go/dispatch/dispatch.go b/sdk/go/dispatch/dispatch.go
index 9fe2e39..3356995 100644
--- a/sdk/go/dispatch/dispatch.go
+++ b/sdk/go/dispatch/dispatch.go
@@ -196,7 +196,7 @@ func (dispatcher *Dispatcher) handleUpdate(container Container) {
 		return
 	}
 
-	if container.State == Queued {
+	if container.State == Queued && container.Priority > 0 {
 		// Try to take the lock
 		if err := dispatcher.UpdateState(container.UUID, Locked); err != nil {
 			return

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