[ARVADOS] created: 1.2.0-303-g925f7e4c3

Git user git at public.curoverse.com
Wed Nov 7 15:56:40 EST 2018


        at  925f7e4c35fb335b3f57000371592db9f2206766 (commit)


commit 925f7e4c35fb335b3f57000371592db9f2206766
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Wed Nov 7 15:53:08 2018 -0500

    14458: Avoid panic by removing defer close()
    
    Channels will be garbage collected when they go unreferenced.
    
    Make the errors channel buffered to avoid lingering goroutines trying
    to send on an unbuffered error channel with no reciever.
    
    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 b9cd20582..38cf409e6 100644
--- a/lib/controller/fed_collections.go
+++ b/lib/controller/fed_collections.go
@@ -209,15 +209,12 @@ func (h *collectionFederatedRequestHandler) ServeHTTP(w http.ResponseWriter, req
 	wg := sync.WaitGroup{}
 	pdh := m[1]
 	success := make(chan *http.Response)
-	errorChan := make(chan error)
+	errorChan := make(chan error, h.handler.Cluster.RequestLimits.GetMultiClusterRequestConcurrency())
 
 	// use channel as a semaphore to limit the number of concurrent
 	// requests at a time
 	sem := make(chan bool, h.handler.Cluster.RequestLimits.GetMultiClusterRequestConcurrency())
 
-	defer close(errorChan)
-	defer close(success)
-	defer close(sem)
 	defer cancelFunc()
 
 	for remoteID := range h.handler.Cluster.RemoteClusters {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list