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

Allow containers to continue even if mount failed after live restore

This fix is a follow up to . In  a bug was fixed for
`docker exec -u user` after live restore by remounting.
However,  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 .

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3003ae1d8b)
This commit is contained in:
Yong Tang 2016-12-15 13:26:27 -08:00 committed by Lei Jitang
parent 43cc971d76
commit 25b967e149

View file

@ -148,8 +148,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)