moby--moby/libnetwork/drivers
Chris Telfer f0c86fb56e Fix deadlock introduced in b64997ea
Commit b64997ea prevented data corruption due to simultaneous
driver.CreateNetwork()/driver.DeleteNetwork() by holding the network
lock through the read/modify part of the operation.  However, part of
the DeleteNetwork operation entails sending a message to the peerDB to
tell that goroutine to flush entries on deletion.  This can lead to a
deadlock where:
  * driver.DeleteNetwork() starts and acquires driver.Lock()
  * peerDB receives some other request (e.g. EventNotify) and blocks
    on driver.Lock()
  * driver.DeleteNetwork() attempts a peerDB flush and blocks waiting
    on the synchronous peerDB operation channel

This patch fixes the issue by deferring the peerDB flush operation until
after DeleteNetwork() unlocks driver.Lock().   Commit b64997ea only
modified CreateNetwork() and DeleteNetwork() and the critical section
that driver.Lock() protects in CreateNetwork() does not perform any
peerDB notifications or other locks of driver data structures.  So this
solution should be a complete fix for any regressions introduced in
b64997ea.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-06-08 14:17:51 -04:00
..
bridge typo: fix misspells in code and comments 2018-05-29 17:08:41 +08:00
host Add ConnectivityScope capability for network drivers along with scope network option 2017-05-12 17:16:34 -07:00
ipvlan Fix type in error message 2018-05-29 08:56:49 -07:00
macvlan Add warning message for the failure of deleting link device 2018-03-06 16:37:45 +08:00
null swarm mode network inspect should provide cluser-wide task details 2017-03-10 19:12:00 -08:00
overlay Fix deadlock introduced in b64997ea 2018-06-08 14:17:51 -04:00
remote Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
windows Delete stale HNS endpoints when creating a network 2018-03-05 00:12:00 -08:00