From 6f43490192b26b722017427ae21689cdc4a4bfcf Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Wed, 11 Mar 2026 18:38:35 +0100 Subject: [PATCH] fix(appd): remove abort_sender entry when session supervisor exits When a runtime process exits naturally (not via TerminateApp) the oneshot Sender remained in abort_senders until shutdown_all(). Add remove_abort_sender() and call it at the normal exit path in supervise() to release the entry immediately. --- crates/weft-appd/src/main.rs | 4 ++++ crates/weft-appd/src/runtime.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/crates/weft-appd/src/main.rs b/crates/weft-appd/src/main.rs index b2c51cb..ed9771c 100644 --- a/crates/weft-appd/src/main.rs +++ b/crates/weft-appd/src/main.rs @@ -101,6 +101,10 @@ impl SessionRegistry { } } + pub(crate) fn remove_abort_sender(&mut self, session_id: u64) { + self.abort_senders.remove(&session_id); + } + pub(crate) fn subscribe(&self) -> tokio::sync::broadcast::Receiver { self.broadcast.subscribe() } diff --git a/crates/weft-appd/src/runtime.rs b/crates/weft-appd/src/runtime.rs index 59fabb3..1306df1 100644 --- a/crates/weft-appd/src/runtime.rs +++ b/crates/weft-appd/src/runtime.rs @@ -286,6 +286,7 @@ pub(crate) async fn supervise( { let mut reg = registry.lock().await; reg.set_state(session_id, AppStateKind::Stopped); + reg.remove_abort_sender(session_id); let _ = reg.broadcast().send(Response::AppState { session_id, state: AppStateKind::Stopped,