Make inspect-rewrite wait if the start operation is still in progress

This commit is contained in:
Bryan Boreham committed 2015-10-30 13:34:16 +00:00
1 parent a6336149f8
commit 5eaff802d4
3 files changed
+21 -3

No files matched your search

+17
View File
@@ -358,6 +358,23 @@ func (proxy *Proxy) waitForStart(r *http.Request) error {
return nil
}
// If some other operation is waiting for a container to start, join in the wait
func (proxy *Proxy) waitForStartByIdent(ident string) {
var ch chan struct{}
proxy.Lock()
for _, wait := range proxy.waiters {
if ident == wait.ident {
ch = wait.ch
break
}
}
proxy.Unlock()
if ch != nil {
Log.Debugf("Wait for start of container %s", ident)
<-ch
}
}
func (proxy *Proxy) ContainerDied(ident string) {
}