From 32e11f538c8ef7b6a57f8906cc02b2c4ac4bb2d0 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Thu, 1 Dec 2022 14:15:13 -0500 Subject: [PATCH] Remove `stop_thread` loop after a `StopAll` --- binaries/runtime/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binaries/runtime/src/lib.rs b/binaries/runtime/src/lib.rs index b7648bd0..fedf559b 100644 --- a/binaries/runtime/src/lib.rs +++ b/binaries/runtime/src/lib.rs @@ -134,11 +134,14 @@ async fn run( if let StopReason::ExplicitStopAll = reason { let hlc = dora_message::uhlc::HLC::default(); let metadata = dora_message::Metadata::new(hlc.new_timestamp()); - let data = metadata.serialize().unwrap(); + let data = metadata + .serialize() + .wrap_err("failed to serialize stop message")?; manual_stop_publisher .publish(&data) .map_err(|err| eyre::eyre!(err)) .wrap_err("failed to send stop message")?; + break; } if let Some(stop_publisher) = operator_stop_publishers.remove(&id) { tracing::info!("operator {node_id}/{id} finished ({reason:?})");