Skip to content

Commit 9dd5990

Browse files
author
Santhosh Manohar
authored
Merge pull request #1364 from mavenugo/dl
Check for isAgent() outside the network lock to avoid deadlocks
2 parents 443b7be + 5e7bf83 commit 9dd5990

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

network.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,13 @@ func (n *network) driver(load bool) (driverapi.Driver, error) {
702702
}
703703

704704
c := n.getController()
705+
isAgent := c.isAgent()
705706
n.Lock()
706707
// If load is not required, driver, cap and err may all be nil
707708
if cap != nil {
708709
n.scope = cap.DataScope
709710
}
710-
if c.isAgent() || n.dynamic {
711+
if isAgent || n.dynamic {
711712
// If we are running in agent mode then all networks
712713
// in libnetwork are local scope regardless of the
713714
// backing driver.

0 commit comments

Comments
 (0)