runtime: wake_slot default ON (RFC 005 accepted, finding 18); supervisor stops survivors sequentially so reverse-order teardown is guaranteed; deflake gen_server/channel tests; baseline.json regenerated slot-on; ROADMAP notes
This commit is contained in:
+14
-3
@@ -396,8 +396,11 @@ impl GenServer for Pool {
|
||||
}
|
||||
|
||||
// A worker spawned and watched from inside a handler delivers its Down to
|
||||
// handle_down. Down arms outrank the inbox, so the death is in the log by
|
||||
// the time the follow-up call is answered.
|
||||
// handle_down. Nothing orders the worker's death before the follow-up
|
||||
// call (the worker sits in the shared queue while call/reply wakes ride the
|
||||
// wake slot), so poll: the log must become exactly [Panic] within a bounded
|
||||
// number of yields. Down-outranks-inbox ordering is covered by
|
||||
// `watch_dead_pid_is_noproc_down`.
|
||||
#[test]
|
||||
fn worker_pool_down_reaches_handle_down() {
|
||||
let got = Arc::new(Mutex::new(Vec::new()));
|
||||
@@ -409,7 +412,15 @@ fn worker_pool_down_reaches_handle_down() {
|
||||
});
|
||||
server.cast(PoolCast::SpawnDoomedWorker).unwrap();
|
||||
let _ = server.call(()).unwrap(); // sync point: cast handled, worker live
|
||||
*got2.lock().unwrap() = server.call(()).unwrap();
|
||||
let mut log = Vec::new();
|
||||
for _ in 0..10_000 {
|
||||
log = server.call(()).unwrap();
|
||||
if !log.is_empty() {
|
||||
break;
|
||||
}
|
||||
smarm::yield_now();
|
||||
}
|
||||
*got2.lock().unwrap() = log;
|
||||
});
|
||||
assert_eq!(*got.lock().unwrap(), vec![DownReason::Panic]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user