[ARVADOS] updated: 1.2.0-304-ga471a7faf

Git user git at public.curoverse.com
Thu Nov 8 10:56:16 EST 2018


Summary of changes:
 lib/controller/fed_collections.go | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

       via  a471a7faf38e636993f56c9bc105d98535942049 (commit)
      from  925f7e4c35fb335b3f57000371592db9f2206766 (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 a471a7faf38e636993f56c9bc105d98535942049
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Thu Nov 8 10:55:47 2018 -0500

    14458: Drain errors channel on failure case instead of accumulating separately
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/lib/controller/fed_collections.go b/lib/controller/fed_collections.go
index 38cf409e6..2121480e1 100644
--- a/lib/controller/fed_collections.go
+++ b/lib/controller/fed_collections.go
@@ -209,7 +209,7 @@ func (h *collectionFederatedRequestHandler) ServeHTTP(w http.ResponseWriter, req
 	wg := sync.WaitGroup{}
 	pdh := m[1]
 	success := make(chan *http.Response)
-	errorChan := make(chan error, h.handler.Cluster.RequestLimits.GetMultiClusterRequestConcurrency())
+	errorChan := make(chan error, len(h.handler.Cluster.RemoteClusters))
 
 	// use channel as a semaphore to limit the number of concurrent
 	// requests at a time
@@ -271,10 +271,10 @@ func (h *collectionFederatedRequestHandler) ServeHTTP(w http.ResponseWriter, req
 	}
 	go func() {
 		wg.Wait()
+		close(errorChan)
 		cancelFunc()
 	}()
 
-	var errors []string
 	errorCode := http.StatusNotFound
 
 	for {
@@ -282,14 +282,16 @@ func (h *collectionFederatedRequestHandler) ServeHTTP(w http.ResponseWriter, req
 		case newResp = <-success:
 			h.handler.proxy.ForwardResponse(w, newResp, nil)
 			return
-		case err := <-errorChan:
-			if httperr, ok := err.(HTTPError); ok {
-				if httperr.Code != http.StatusNotFound {
-					errorCode = http.StatusBadGateway
+		case <-sharedContext.Done():
+			var errors []string
+			for err := range errorChan {
+				if httperr, ok := err.(HTTPError); ok {
+					if httperr.Code != http.StatusNotFound {
+						errorCode = http.StatusBadGateway
+					}
 				}
+				errors = append(errors, err.Error())
 			}
-			errors = append(errors, err.Error())
-		case <-sharedContext.Done():
 			httpserver.Errors(w, errors, errorCode)
 			return
 		}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list