Skip to content

Sometimes moves fail to transmit only when a soft shutdown has been triggered #1155

@nfaltermeier

Description

@nfaltermeier

Describe the bug
Sometimes the program does not transmit a move from the engine to lichess when a soft shutdown has been triggered by pressing Ctrl-C once with quit_after_all_games_finish: true enabled. From the lichess-bot logs I can see that the engine has given a bestmove, but it does not get sent and the game will timeout if I do not forcibly shut down lichess-bot and restart it. This only happens when I have pressed Ctrl-C once, my engine does not normally timeout.

When this happens while 2+ concurrent games are running, it may only affect one game and other game(s) may proceed as normal.

I think having 2+ concurrent games running when Ctrl-C is pressed is correlated with this bug happening, but I am not sure if it is required for this to happen.

To Reproduce

  1. Set quit_after_all_games_finish: true in config.yml
  2. Run lichess-bot with python lichess-bot.py
  3. Wait for the bot to have a game or two running
  4. Press Ctrl-C once to prevent it from accepting new games
  5. Watch and see if it fails to transmit a move. This does not happen every time.

Expected behavior
It successfully transmits the move to lichess or at least prints an error saying it failed to transmit the move and tries again

Logs
bug-report-log-snippet.log

I pressed Ctrl-C once while it was playing 2 games to tell it to shutdown after those games.
Line 177 is where my engine gave the best move for the 1st game which did not get transmitted to lichess.
Line 249 is where my engine gave the best move for the 2nd game which did not get transmitted to lichess.
At 23:14:16 must have been when I started pressing Ctrl-C to get it to close before the bot lost its games due to time.

Desktop (please complete the following information):

  • OS: Windows 10
  • Python Version: Python 3.10.11
  • Terminal: It has happened with both Powershell and Git Bash

Additional context
I am seeing this on commit 36d322e. In the past I was seeing this on commit a1302ed and IIRC on earlier versions too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions