Move plugin shutdown after layerstore shtudown
This ensures that graphdriver plugins can properly cleanup on daemon exit. Also prevents errors during shutdown when it tries to send the plugin a `Cleanup()` request but ultimately times out since it's already been shutdown. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
8e0794aae0
commit
4b400ecc4d
|
@ -792,7 +792,13 @@ func (daemon *Daemon) Shutdown() error {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown plugins after containers. Don't change the order.
|
if daemon.layerStore != nil {
|
||||||
|
if err := daemon.layerStore.Cleanup(); err != nil {
|
||||||
|
logrus.Errorf("Error during layer Store.Cleanup(): %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shutdown plugins after containers and layerstore. Don't change the order.
|
||||||
daemon.pluginShutdown()
|
daemon.pluginShutdown()
|
||||||
|
|
||||||
// trigger libnetwork Stop only if it's initialized
|
// trigger libnetwork Stop only if it's initialized
|
||||||
|
@ -800,12 +806,6 @@ func (daemon *Daemon) Shutdown() error {
|
||||||
daemon.netController.Stop()
|
daemon.netController.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
if daemon.layerStore != nil {
|
|
||||||
if err := daemon.layerStore.Cleanup(); err != nil {
|
|
||||||
logrus.Errorf("Error during layer Store.Cleanup(): %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := daemon.cleanupMounts(); err != nil {
|
if err := daemon.cleanupMounts(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue