From b86d9bf1ab78ca0762816fbb4648a84354ae6ee9 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Tue, 22 Sep 2015 11:59:06 +0100 Subject: [PATCH] [proxy] fix race condition when waiting for containers to start If ContainerStarted fired before the response handler, then the "waiter" chan would be nil, and the response handler would hang. --- proxy/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index b2b6fac8..eeead60a 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -312,7 +312,7 @@ func (proxy *Proxy) waitForStart(r *http.Request) { ch = wait.ch } proxy.Unlock() - if found { + if ch != nil { Log.Debugf("Wait for start of container %s", wait.ident) <-ch }