🪲 BUG-#245: Fix TimeoutError not caught on Python 3.9/3.10#253
Merged
FernandoCelmer merged 3 commits intodevelopfrom Apr 12, 2026
Merged
🪲 BUG-#245: Fix TimeoutError not caught on Python 3.9/3.10#253FernandoCelmer merged 3 commits intodevelopfrom
FernandoCelmer merged 3 commits intodevelopfrom
Conversation
FernandoCelmer
commented
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
concurrent.futures.TimeoutError as FuturesTimeoutErrorTimeoutErrorandFuturesTimeoutErrorinexecute_with_retry(line 136) and_execute_with_timeout(line 181)TimeoutError() from Nonefor clean tracebackProblem
On Python 3.9/3.10,
concurrent.futures.TimeoutErroris a separate class that does not inherit frombuiltins.TimeoutError. The code only caughtTimeoutError(builtin), sofuture.result(timeout=N)raised an uncaught exception that bypassed retry logic.On Python 3.11+, they unified the classes so the bug was invisible.
Tests
test_timeout_expired_marks_task_failed— real timeout withsleep(5)andtimeout=1test_futures_timeout_error_is_caught— mocks_execute_with_timeoutto raiseFuturesTimeoutErrordirectlyTest plan
.code_quality/ruff.tomlCloses #245