From a478cc66d8d8565496adcac49e8ec55b532f689f Mon Sep 17 00:00:00 2001 From: Captain Meow Date: Thu, 3 Dec 2020 12:24:38 +0530 Subject: [PATCH] use old state to restart the child (#289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: பாலாஜி --- src/bastion/src/children.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bastion/src/children.rs b/src/bastion/src/children.rs index 2dc03ba4..64fe328b 100644 --- a/src/bastion/src/children.rs +++ b/src/bastion/src/children.rs @@ -616,14 +616,12 @@ impl Children { let children = self.as_ref(); let supervisor = self.bcast.parent().clone().into_supervisor(); - let state = Arc::new(Box::pin(ContextState::new())); - let ctx = BastionContext::new( id.clone(), child_ref.clone(), children, supervisor, - state.clone(), + old_state.clone(), ); let exec = (self.init.0)(ctx); @@ -643,6 +641,7 @@ impl Children { debug!("Children({}): Restarting Child({}).", self.id(), bcast.id()); let callbacks = self.callbacks.clone(); + let state = Arc::new(Box::pin(ContextState::new())); let child = Child::new(exec, callbacks, bcast, state, child_ref); debug!( "Children({}): Launching faulted Child({}).",