1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1487 from mrjana/networkdb

Do not hold ack channel in ack table after closing
This commit is contained in:
Alessandro Boch 2016-10-03 11:44:42 -07:00 committed by GitHub
commit 421f6e0bf6
2 changed files with 3 additions and 6 deletions

View file

@ -559,10 +559,6 @@ func (nDB *NetworkDB) bulkSyncNode(networks []string, node string, unsolicited b
case <-t.C:
logrus.Errorf("Bulk sync to node %s timed out", node)
case <-ch:
nDB.Lock()
delete(nDB.bulkSyncAckTbl, node)
nDB.Unlock()
logrus.Debugf("%s: Bulk sync to node %s took %s", nDB.config.NodeName, node, time.Now().Sub(startTime))
}
t.Stop()

View file

@ -318,12 +318,13 @@ func (nDB *NetworkDB) handleBulkSync(buf []byte) {
// Don't respond to a bulk sync which was not unsolicited
if !bsm.Unsolicited {
nDB.RLock()
nDB.Lock()
ch, ok := nDB.bulkSyncAckTbl[bsm.NodeName]
nDB.RUnlock()
if ok {
close(ch)
delete(nDB.bulkSyncAckTbl, bsm.NodeName)
}
nDB.Unlock()
return
}