mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1364 from mavenugo/dl
Check for isAgent() outside the network lock to avoid deadlocks
This commit is contained in:
commit
e42fca1872
1 changed files with 2 additions and 1 deletions
|
@ -702,12 +702,13 @@ func (n *network) driver(load bool) (driverapi.Driver, error) {
|
|||
}
|
||||
|
||||
c := n.getController()
|
||||
isAgent := c.isAgent()
|
||||
n.Lock()
|
||||
// If load is not required, driver, cap and err may all be nil
|
||||
if cap != nil {
|
||||
n.scope = cap.DataScope
|
||||
}
|
||||
if c.isAgent() || n.dynamic {
|
||||
if isAgent || n.dynamic {
|
||||
// If we are running in agent mode then all networks
|
||||
// in libnetwork are local scope regardless of the
|
||||
// backing driver.
|
||||
|
|
Loading…
Add table
Reference in a new issue