docs(#2270): soften take_wake_suppressed one-shot claim per argus review

Argus flagged the doc comment overclaiming no risk of a stale
suppression leaking onto a reused task id — narrow the wording to
match the acknowledged race in run_task's completion handler.
This commit is contained in:
atlas 2026-07-13 16:22:13 +02:00 committed by mara
commit 5e489b0880

View file

@ -88,10 +88,12 @@ pub(crate) fn suppress_wake(id: &str) {
}
/// Consume (remove + report) `id`'s suppression flag. Returns `true` if the
/// wake should be skipped. One-shot: a task id is only ever completed once,
/// so there's no risk of a stale suppression leaking onto a later task with
/// the same id (names are only reusable once the prior task has finished,
/// i.e. after this has already been consumed).
/// wake should be skipped. One-shot by intent: a completed task's entry is
/// meant to be drained exactly once. There's a known low-probability race
/// (see `run_task`'s completion handler) where `suppress_wake` for a task
/// fires *after* this has already run for it — if the same name gets reused
/// before that late insert lands, the dangling flag could suppress the new
/// task's wake instead. Not eliminated, just narrow.
fn take_wake_suppressed(id: &str) -> bool {
wake_suppressed().lock().unwrap().remove(id)
}