From ff2721cc0f60fff6c19adb2eb90e78238cbcb0e7 Mon Sep 17 00:00:00 2001 From: atlas Date: Sat, 1 Aug 2026 19:13:50 +0200 Subject: [PATCH] docs(#2815): fix suppress_crash_watch's stale doc comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The doc still described a `label`/`deliberate_stop` parameter pair inherited from `transient_guard`, which this function replaced and whose signature it does not share — it only takes `name`. Rewritten to say what it does and, more usefully, what must not come through it: the queue answers the same question from the node itself via `NodeKind::takes_container_down`, so this path is only for the two operations that have no node behind them yet. --- hive-c0re/src/coordinator.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index d03ec18a..4b9e1366 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -1254,16 +1254,18 @@ impl Coordinator { map.iter().map(|(k, v)| (k.clone(), v.len())).collect() } - /// Set a transient state and return a guard that clears it on drop. - /// Use this from any path where the surrounding future could be - /// cancelled or panic between set and clear (HTTP handlers, spawned - /// tasks). The guard's `Drop` runs even on task cancellation, so - /// the dashboard's spinner can't get pinned forever. + /// Tell the crash watcher that `name`'s container is going down **on + /// purpose**, for the lifetime of the returned guard. See + /// [`CrashWatchSuppression`] for why this exists at all. /// - /// `label` is what the pill renders; `deliberate_stop` says whether this - /// operation takes the container down on purpose, and is what the crash - /// watcher reads. Only the caller knows the second one — it is not - /// recoverable from the first. + /// Only for the operations with no queue node behind them. Anything the + /// job queue runs answers this from the node itself + /// ([`crate::job_queue::NodeKind::takes_container_down`]) and must not come + /// through here. + /// + /// The guard's `Drop` runs even on task cancellation, so an aborted HTTP + /// request or a panic mid-destroy can't leave a container permanently + /// exempt from crash reporting. pub fn suppress_crash_watch(self: &Arc, name: &str) -> CrashWatchSuppression { self.crash_suppressed .lock()