Skip to content

Commit

Permalink
Merge pull request moby#1364 from mavenugo/dl
Browse files Browse the repository at this point in the history
Check for isAgent() outside the network lock to avoid deadlocks
  • Loading branch information
Santhosh Manohar authored Jul 28, 2016
2 parents 443b7be + 5e7bf83 commit 9dd5990
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9dd5990

Please sign in to comment.