mirror of https://github.com/docker/docs.git
Merge pull request #1813 from dongluochen/enginePanic
Lock engine to prevent read/write conflict on engine `containers` map
This commit is contained in:
commit
ad232fcec6
|
@ -585,7 +585,10 @@ func (e *Engine) refreshContainer(ID string, full bool) (*Container, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = e.updateContainer(containers[0], e.containers, full)
|
_, err = e.updateContainer(containers[0], e.containers, full)
|
||||||
return e.containers[containers[0].Id], err
|
e.RLock()
|
||||||
|
container := e.containers[containers[0].Id]
|
||||||
|
e.RUnlock()
|
||||||
|
return container, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Engine) updateContainer(c dockerclient.Container, containers map[string]*Container, full bool) (map[string]*Container, error) {
|
func (e *Engine) updateContainer(c dockerclient.Container, containers map[string]*Container, full bool) (map[string]*Container, error) {
|
||||||
|
|
Loading…
Reference in New Issue