[ARVADOS] updated: 7846843453df9846c346f85c20a8d6d051066f52

Git user git at public.curoverse.com
Thu Sep 8 17:07:24 EDT 2016


Summary of changes:
 services/api/test/fixtures/jobs.yml |  6 +++---
 services/api/test/unit/job_test.rb  | 22 ++++++++++++++++++++++
 services/keep-balance/balance.go    | 19 +++++++++++--------
 3 files changed, 36 insertions(+), 11 deletions(-)

       via  7846843453df9846c346f85c20a8d6d051066f52 (commit)
       via  07ad9aa37c3b907adf85821a192041b5bb478fec (commit)
       via  795125d3d998bc1fdbaf31d7d3dd048564f8e685 (commit)
       via  9bad58fd3334bab5c9a09f365912a37c5f63fcdc (commit)
      from  cdc4b9c4561f09b4cfb59f4b61689a661823ad85 (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 7846843453df9846c346f85c20a8d6d051066f52
Merge: 07ad9aa 795125d
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 8 17:06:58 2016 -0400

    Merge branch '9996-stop-on-error'
    
    closes #9996


commit 07ad9aa37c3b907adf85821a192041b5bb478fec
Merge: cdc4b9c 9bad58f
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 8 17:06:03 2016 -0400

    Merge branch '9888-unit-tests'
    
    closes #9888


commit 795125d3d998bc1fdbaf31d7d3dd048564f8e685
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Sep 8 17:02:22 2016 -0400

    9996: Stop retrieving collections if a fatal error makes any further work futile.

diff --git a/services/keep-balance/balance.go b/services/keep-balance/balance.go
index 25b474b..8fc06c3 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -244,6 +244,12 @@ func (bal *Balancer) GetCurrentState(c *arvados.Client, pageSize, bufs int) erro
 				errs <- fmt.Errorf("%s: %v", srv, err)
 				return
 			}
+			if len(errs) > 0 {
+				// Some other goroutine encountered an
+				// error -- any futher effort here
+				// will be wasted.
+				return
+			}
 			bal.logf("%s: add %d replicas to map", srv, len(idx))
 			bal.BlockStateMap.AddReplicas(srv, idx)
 			bal.logf("%s: done", srv)
@@ -298,14 +304,11 @@ func (bal *Balancer) GetCurrentState(c *arvados.Client, pageSize, bufs int) erro
 		}
 	}()
 
-	go func() {
-		// Send a nil error when all goroutines finish. If
-		// this is the first error sent to errs, then
-		// everything worked.
-		wg.Wait()
-		errs <- nil
-	}()
-	return <-errs
+	wg.Wait()
+	if len(errs) > 0 {
+		return <-errs
+	}
+	return nil
 }
 
 func (bal *Balancer) addCollection(coll arvados.Collection) error {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list