From 837853ffd20d15214e2aedcf0ff29e9b449fc997 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Wed, 10 May 2023 19:33:24 +0300 Subject: [PATCH] doc: mention about spawn_blocking canceling --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec2b6144cc..a69f4548ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,10 @@ Please be aware of at least these common problems: dropped is that a future is polled or raced within `tokio::select!` with a cancellation token or the HTTP client drops the connection, causing a cancellation or drop on a handler future. + + Additionally please note that blocking tasks spawned with + `tokio::spawn_blocking` directly or indirectly will not be + cancelled with the spawning future. 2. When using `scopeguard` or generally within `Drop::drop`, the code must not panic