mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-26 17:03:09 +00:00
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.
This commit is contained in:
parent
4445b57a7c
commit
6f43490192
2 changed files with 5 additions and 0 deletions
|
|
@ -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<Response> {
|
pub(crate) fn subscribe(&self) -> tokio::sync::broadcast::Receiver<Response> {
|
||||||
self.broadcast.subscribe()
|
self.broadcast.subscribe()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -286,6 +286,7 @@ pub(crate) async fn supervise(
|
||||||
{
|
{
|
||||||
let mut reg = registry.lock().await;
|
let mut reg = registry.lock().await;
|
||||||
reg.set_state(session_id, AppStateKind::Stopped);
|
reg.set_state(session_id, AppStateKind::Stopped);
|
||||||
|
reg.remove_abort_sender(session_id);
|
||||||
let _ = reg.broadcast().send(Response::AppState {
|
let _ = reg.broadcast().send(Response::AppState {
|
||||||
session_id,
|
session_id,
|
||||||
state: AppStateKind::Stopped,
|
state: AppStateKind::Stopped,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue