From 3003ae1d8bd112e78bcc8c1c70efd9d3ef6f0ddc Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Thu, 15 Dec 2016 13:26:27 -0800 Subject: [PATCH] Allow containers to continue even if mount failed after live restore This fix is a follow up to #29365. In #29365 a bug was fixed for `docker exec -u user` after live restore by remounting. However, #29365 will prevent containers from restored if mount failed. In this fix, containers will be restored even if mount in that step failed. Some functionalities might be missing (like `docker exec -u user`) but at least it is possible to do certain operations like stop/restart/delete. This fix is related to #29365. Signed-off-by: Yong Tang --- daemon/daemon.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index ae56267f04..a09d2b6fdd 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -150,8 +150,13 @@ func (daemon *Daemon) restore() error { } container.RWLayer = rwlayer if err := daemon.Mount(container); err != nil { - logrus.Errorf("Failed to mount container %v: %v", id, err) - continue + // The mount is unlikely to fail. However, in case mount fails + // the container should be allowed to restore here. Some functionalities + // (like docker exec -u user) might be missing but container is able to be + // stopped/restarted/removed. + // See #29365 for related information. + // The error is only logged here. + logrus.Warnf("Failed to mount container %v: %v", id, err) } logrus.Debugf("Loaded container %v", container.ID)