Fail teardown when control withdrawal fails
This commit is contained in:
parent
da7557b850
commit
a9c9cf7ab3
1 changed files with 51 additions and 11 deletions
|
|
@ -449,9 +449,10 @@ impl LifecycleAdapter for ProductionLifecycleAdapter<'_> {
|
|||
LifecycleAction::ReleasePreparedLowerLease => self.release_prepared_lower(),
|
||||
LifecycleAction::GracefulSupervisorExit => self.graceful_exit(),
|
||||
LifecycleAction::BeginTeardown => {
|
||||
if let Some(control) = self.published_control.take() {
|
||||
control.withdraw();
|
||||
if let Some(control) = self.published_control.as_ref() {
|
||||
control.withdraw().map_err(failure)?;
|
||||
}
|
||||
self.published_control.take();
|
||||
Ok(())
|
||||
}
|
||||
LifecycleAction::FinishTeardown => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue