From b6f646cacd420660a408f75cd44af27476c54503 Mon Sep 17 00:00:00 2001 From: Sun Hongliang Date: Mon, 4 Apr 2016 13:22:37 +0800 Subject: [PATCH] log err when remove container fails in rescheduling Signed-off-by: Sun Hongliang --- cluster/watchdog.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cluster/watchdog.go b/cluster/watchdog.go index eca3a2abe5..c208d2db79 100644 --- a/cluster/watchdog.go +++ b/cluster/watchdog.go @@ -45,9 +45,11 @@ func (w *Watchdog) removeDuplicateContainers(e *Engine) { for _, containerInCluster := range w.cluster.Containers() { if containerInCluster.Config.SwarmID() == container.Config.SwarmID() && containerInCluster.Engine.ID != container.Engine.ID { - log.Debugf("container %s was rescheduled on node %s, removing it", container.Id, containerInCluster.Engine.ID) + log.Debugf("container %s was rescheduled on node %s, removing it", container.Id, containerInCluster.Engine.Name) // container already exists in the cluster, destroy it - e.RemoveContainer(container, true, true) + if err := e.RemoveContainer(container, true, true); err != nil { + log.Errorf("Failed to remove duplicate container %s on node %s: %v", container.Id, containerInCluster.Engine.Name, err) + } } } }