Skip to content

Fix empty range in terminate_pool_with_backoff making it a no-op#4784

Open
codewithfourtix wants to merge 2 commits intoaboutcode-org:developfrom
codewithfourtix:fix-terminate-pool-backoff-windows
Open

Fix empty range in terminate_pool_with_backoff making it a no-op#4784
codewithfourtix wants to merge 2 commits intoaboutcode-org:developfrom
codewithfourtix:fix-terminate-pool-backoff-windows

Conversation

@codewithfourtix
Copy link

@codewithfourtix codewithfourtix commented Mar 1, 2026

Fix terminate_pool_with_backoff no-op loop on Windows

range(number_of_trials, 1) evaluates to range(3, 1) which produces an empty sequence since the default step is +1. As a result, the retry loop never executes, making terminate_pool_with_backoff a complete no-op on Windows — pool termination is never attempted on failure.

Tasks

range(number_of_trials, 1) with number_of_trials=3 produces an empty
range since the default step is +1 and 3 > 1. The retry loop body
never executed, so on Windows pool termination with backoff never
happened. Fix by using range(number_of_trials) to iterate correctly.

Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
Copilot AI review requested due to automatic review settings March 1, 2026 18:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a Windows-only bug where terminate_pool_with_backoff() never executed its retry loop due to an empty range(), preventing process pool termination attempts after failures.

Changes:

  • Corrects the retry loop range in terminate_pool_with_backoff() so termination is attempted on Windows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Ensure the retry loop actually executes and calls pool.terminate()
at least once, and retries correctly on WindowsError. Prevents the
old range(number_of_trials, 1) empty-range bug from regressing.

Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants