Log stale resource cleanup

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2016-03-16 10:14:16 -07:00
parent 613d0ff72a
commit 9c88ee206e
2 changed files with 3 additions and 1 deletions

View File

@ -996,6 +996,7 @@ func (c *controller) cleanupLocalEndpoints() {
}
for _, ep := range epl {
log.Infof("Removing stale endpoint %s (%s)", ep.name, ep.id)
if err := ep.Delete(true); err != nil {
log.Warnf("Could not delete local endpoint %s during endpoint cleanup: %v", ep.name, err)
}
@ -1009,7 +1010,7 @@ func (c *controller) cleanupLocalEndpoints() {
epCnt := n.getEpCnt().EndpointCnt()
if epCnt != uint64(len(epl)) {
log.Warnf("Inconsistent endpoint_cnt for network %s. Expected=%d, Actual=%d", n.name, len(epl), epCnt)
log.Infof("Fixing inconsistent endpoint_cnt for network %s. Expected=%d, Actual=%d", n.name, len(epl), epCnt)
n.getEpCnt().setCnt(uint64(len(epl)))
}
}

View File

@ -226,6 +226,7 @@ func (c *controller) sandboxCleanup() {
heap.Push(&sb.endpoints, ep)
}
logrus.Infof("Removing stale sandbox %s (%s)", sb.id, sb.containerID)
if err := sb.delete(true); err != nil {
logrus.Errorf("failed to delete sandbox %s while trying to cleanup: %v", sb.id, err)
}