From 33566434bba678c492a5b03b24a013d2f8710c6e Mon Sep 17 00:00:00 2001 From: Joe Thomas <80063237+joe-amzn@users.noreply.github.com> Date: Mon, 29 Dec 2025 07:45:58 -0600 Subject: [PATCH] metrics: clarify that `num_alive_tasks` is not strongly consistent (#7614) --- tokio/src/runtime/metrics/runtime.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tokio/src/runtime/metrics/runtime.rs b/tokio/src/runtime/metrics/runtime.rs index adb84416c..8aeb608bd 100644 --- a/tokio/src/runtime/metrics/runtime.rs +++ b/tokio/src/runtime/metrics/runtime.rs @@ -54,6 +54,10 @@ impl RuntimeMetrics { /// This counter increases when a task is spawned and decreases when a /// task exits. /// + /// Note: When using the multi-threaded runtime this number may not + /// not have strong consistency i.e. no tasks may be running but the metric + /// reports otherwise. + /// /// # Examples /// /// ```