Stop the control server only once.
Operations are now shut down automatically by the main Stop command, and it is not necessary to call Stop during Destroy. Fixes #5454 PiperOrigin-RevId: 357295930
This commit is contained in:
parent
33c617cae3
commit
3ef012944d
|
@ -477,14 +477,16 @@ func createProcessArgs(id string, spec *specs.Spec, creds *auth.Credentials, k *
|
||||||
// been closed. For that reason, this should NOT be called in a defer, because
|
// been closed. For that reason, this should NOT be called in a defer, because
|
||||||
// a panic in a control server rpc would then hang forever.
|
// a panic in a control server rpc would then hang forever.
|
||||||
func (l *Loader) Destroy() {
|
func (l *Loader) Destroy() {
|
||||||
if l.ctrl != nil {
|
|
||||||
l.ctrl.srv.Stop()
|
|
||||||
}
|
|
||||||
if l.stopSignalForwarding != nil {
|
if l.stopSignalForwarding != nil {
|
||||||
l.stopSignalForwarding()
|
l.stopSignalForwarding()
|
||||||
}
|
}
|
||||||
l.watchdog.Stop()
|
l.watchdog.Stop()
|
||||||
|
|
||||||
|
// Stop the control server. This will indirectly stop any
|
||||||
|
// long-running control operations that are in flight, e.g.
|
||||||
|
// profiling operations.
|
||||||
|
l.ctrl.stop()
|
||||||
|
|
||||||
// Release all kernel resources. This is only safe after we can no longer
|
// Release all kernel resources. This is only safe after we can no longer
|
||||||
// save/restore.
|
// save/restore.
|
||||||
l.k.Release()
|
l.k.Release()
|
||||||
|
@ -1055,9 +1057,6 @@ func (l *Loader) WaitExit() kernel.ExitStatus {
|
||||||
// Wait for container.
|
// Wait for container.
|
||||||
l.k.WaitExited()
|
l.k.WaitExited()
|
||||||
|
|
||||||
// Stop the control server.
|
|
||||||
l.ctrl.stop()
|
|
||||||
|
|
||||||
// Check all references.
|
// Check all references.
|
||||||
refs.OnExit()
|
refs.OnExit()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue