From 22a3b101714d8756f2d239ee3199b555d3396712 Mon Sep 17 00:00:00 2001 From: Jonathan Bastien-Filiatrault Date: Thu, 19 Sep 2019 14:12:04 -0400 Subject: [PATCH] executor: fix blocking pool bug re: thread shutdown (#1562) Currently, when threads in the blocking pool shutdown due to being idle the counter tracking threads is not decremented. This prevents new threads from being spawned to replace the shutdown threads. --- tokio-executor/src/blocking.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tokio-executor/src/blocking.rs b/tokio-executor/src/blocking.rs index b24be56fa..424d46767 100644 --- a/tokio-executor/src/blocking.rs +++ b/tokio-executor/src/blocking.rs @@ -118,6 +118,8 @@ fn spawn_thread() { run_task(task); continue 'outer; } else if timeout_result.timed_out() { + shared.num_idle = shared.num_idle.saturating_sub(1); + shared.num_th -= 1; break 'outer; } }