mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1426 from mrjana/bugs
Decrement epCnt only after all cleanup
This commit is contained in:
commit
7a71a4ab83
1 changed files with 4 additions and 11 deletions
|
@ -757,17 +757,6 @@ func (ep *endpoint) Delete(force bool) error {
|
|||
}
|
||||
}()
|
||||
|
||||
if err = n.getEpCnt().DecEndpointCnt(); err != nil && !force {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil && !force {
|
||||
if e := n.getEpCnt().IncEndpointCnt(); e != nil {
|
||||
log.Warnf("failed to update network %s : %v", n.name, e)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
// unwatch for service records
|
||||
n.getController().unWatchSvcRecord(ep)
|
||||
|
||||
|
@ -777,6 +766,10 @@ func (ep *endpoint) Delete(force bool) error {
|
|||
|
||||
ep.releaseAddress()
|
||||
|
||||
if err := n.getEpCnt().DecEndpointCnt(); err != nil {
|
||||
log.Warnf("failed to decrement endpoint coint for ep %s: %v", ep.ID(), err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue