Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent hangs due to timeout errors #897

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

MarkZH
Copy link
Collaborator

@MarkZH MarkZH commented Jan 29, 2024

Type of pull request:

  • Bug fix
  • Feature
  • Other

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:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

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.
@MarkZH
Copy link
Collaborator Author

MarkZH commented Jan 29, 2024

I copied the changed files into a new branch, which somehow fixed the whitespace issue. Very annoying.

@AttackingOrDefending AttackingOrDefending merged commit 380e539 into lichess-bot-devs:master Jan 30, 2024
15 checks passed
@MarkZH MarkZH deleted the timeout-hang-fix branch January 30, 2024 19:56
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.

Bot doesn't play the move supplied by the engine through UCI
2 participants