Prevent hangs due to timeout errors #897
Merged
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.
Type of pull request:
Description:
If a user sets a finite value for movetime in their config file (e.g., engine: uci_options: go_commands: movetime) and the engine takes significantly longer to pick a move (10 seconds longer by default), then the python-chess framework will cancel the search for a move and raise a TimeoutError.
Before this PR, this would cause lichess-bot to hang and stop listening to the engine. Now, the error propagates to the backoff decorator so that the engine can be restarted.
Related Issues:
This PR closes #893 and should be a better solution to #623 than the previous PR #628.
Checklist: