mirror of
https://github.com/containers/podman.git
synced 2025-10-09 23:15:39 +08:00
When shutting down the runtime we should always close the database
Even if the storage fails to shutdown. This patch fixes on TODO. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #97 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
5c9694a0c1
commit
55c8b69d8f
@ -225,11 +225,16 @@ func (r *Runtime) Shutdown(force bool) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := r.store.Shutdown(force)
|
var lastError error
|
||||||
if err != nil {
|
if _, err := r.store.Shutdown(force); err != nil {
|
||||||
return err
|
lastError = errors.Wrapf(err, "Error shutting down container storage")
|
||||||
|
}
|
||||||
|
if err := r.state.Close(); err != nil {
|
||||||
|
if lastError != nil {
|
||||||
|
logrus.Errorf("%v", lastError)
|
||||||
|
}
|
||||||
|
lastError = err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Should always call this even if store.Shutdown failed
|
return lastError
|
||||||
return r.state.Close()
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user