From 473ce7db088e7731bb0b97d9644b000f02687b8e Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Sat, 24 Oct 2015 08:51:15 -0700 Subject: [PATCH] Dont notify the leave if the serf is not inited Overlay driver allows local containers to communicate in overly network even when the serf is not fully inited. But when the container leaves an overlay network, it gets stuck waiting on a nil notifyCh, when the serf is not fully initialized. Signed-off-by: Madhu Venugopal --- libnetwork/drivers/overlay/joinleave.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libnetwork/drivers/overlay/joinleave.go b/libnetwork/drivers/overlay/joinleave.go index 1ce123cc51..4e844d4c45 100644 --- a/libnetwork/drivers/overlay/joinleave.go +++ b/libnetwork/drivers/overlay/joinleave.go @@ -118,10 +118,12 @@ func (d *driver) Leave(nid, eid string) error { return fmt.Errorf("could not find network with id %s", nid) } - d.notifyCh <- ovNotify{ - action: "leave", - nid: nid, - eid: eid, + if d.notifyCh != nil { + d.notifyCh <- ovNotify{ + action: "leave", + nid: nid, + eid: eid, + } } n.leaveSandbox()