From 017adc985889fd217b003a621f56288c1f2e2067 Mon Sep 17 00:00:00 2001 From: Noah Kennedy Date: Fri, 4 Oct 2024 11:06:28 -0500 Subject: [PATCH] document that only blocking tasks leak --- tokio/src/runtime/local_runtime/runtime.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tokio/src/runtime/local_runtime/runtime.rs b/tokio/src/runtime/local_runtime/runtime.rs index c174749631b..9908c856709 100644 --- a/tokio/src/runtime/local_runtime/runtime.rs +++ b/tokio/src/runtime/local_runtime/runtime.rs @@ -295,6 +295,9 @@ impl LocalRuntime { /// Shuts down the runtime, waiting for at most `duration` for all spawned /// work to stop. /// + /// Note that `spawn_blocking` tasks, and only `spawn_blocking` tasks, can get left behind if + /// the timeout expires. + /// /// See the [struct level documentation](LocalRuntime#shutdown) for more details. /// /// # Examples @@ -333,7 +336,7 @@ impl LocalRuntime { /// /// Note however, that because we do not wait for any blocking tasks to complete, this /// may result in a resource leak (in that any blocking tasks are still running until they - /// return. + /// return. No other tasks will leak. /// /// See the [struct level documentation](LocalRuntime#shutdown) for more details. ///