diff --git a/ROADMAP.md b/ROADMAP.md index 80ccf7d..a974cca 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -304,7 +304,13 @@ outright — `join` what you need finished. No forcing sweep follows. kill); OTP would deliver a trappable `killed`. Chosen for boundedness. - A root-exit shutdown reaches only actors live *at that instant*; a non-trapping forest root that spawns before it unwinds leaves that spawn - to itself (Erlang: an unlinked spawn is nobody's child). + to itself (Erlang: an unlinked spawn is nobody's child). The same holds + for children it already had: they sit under a live parent at sweep time, + so they are skipped, and stopping the parent does not reach them. A child + that loops until told otherwise then keeps the run alive (seen as a hang in + `try_spawn`'s race test whenever its root panicked mid-race). Closing it + means sweeping a forest root's live children when it finalizes after root + exit; that changes teardown semantics, so it is not done yet. - **Supervisor start *order* is not start *readiness*.** `start_child` spawns and moves straight on, so an earlier child is merely *scheduled*, not initialised, when a later sibling starts. A later child that resolves diff --git a/src/runtime.rs b/src/runtime.rs index e7dbed0..4391d2d 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -2116,9 +2116,10 @@ fn shutdown_forest_roots(inner: &Arc, root: Pid) { .is_some_and(|ps| ps.is_live_for(parent)); if !parent_live { // `_probe` so the trace can say what each leftover was: under - // `smarm-trace` every swept actor is a `root_sweep` line — the - // visibility that makes "a forgotten actor costs only a slot, never - // a hung run" a checkable claim rather than a hope. + // `smarm-trace` every swept actor is a `root_sweep` line. Only + // forest roots are swept: a non-trapping child of a parent still + // live here is never addressed, and if it never exits on its own + // it keeps the run alive after that parent is stopped. let found = crate::scheduler::request_shutdown_inner_probe(inner, pid, root); #[cfg_attr(not(feature = "smarm-trace"), allow(unused_variables))] if let Some(trapping) = found {