[ARVADOS] created: 1.1.4-661-gd91eb0fae

Git user git at public.curoverse.com
Thu Jul 19 15:27:54 EDT 2018


        at  d91eb0fae8d2ef4c2348769694573bf725ef16d4 (commit)


commit d91eb0fae8d2ef4c2348769694573bf725ef16d4
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Jul 19 15:26:02 2018 -0400

    13788: Fix concurrent map write.
    
    Reading multiple pages into the same ContainerList was reusing
    embedded maps that had been passed to other goroutines.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/sdk/go/dispatch/dispatch.go b/sdk/go/dispatch/dispatch.go
index 3289c67b0..c3d603099 100644
--- a/sdk/go/dispatch/dispatch.go
+++ b/sdk/go/dispatch/dispatch.go
@@ -162,19 +162,21 @@ func (d *Dispatcher) checkForUpdates(filters [][]interface{}, todo map[string]*r
 	params := arvadosclient.Dict{
 		"filters": filters,
 		"order":   []string{"priority desc"}}
-
-	var list arvados.ContainerList
-	for offset, more := 0, true; more; offset += len(list.Items) {
+	offset := 0
+	for {
 		params["offset"] = offset
+		var list arvados.ContainerList
 		err := d.Arv.List("containers", params, &list)
 		if err != nil {
 			log.Printf("Error getting list of containers: %q", err)
 			return false
 		}
-		more = len(list.Items) > 0 && list.ItemsAvailable > len(list.Items)+offset
 		d.checkListForUpdates(list.Items, todo)
+		offset += len(list.Items)
+		if len(list.Items) == 0 || list.ItemsAvailable <= offset {
+			return true
+		}
 	}
-	return true
 }
 
 func (d *Dispatcher) checkListForUpdates(containers []arvados.Container, todo map[string]*runTracker) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list