Closed arvyy closed 7 months ago
Can you post the entire log of that session?
sorry, looks like the log doesn't go that back far
one thing I noticed, is that engine disrespected movetime parameter by a lot (my engine is still pretty primitive and doesn't obey all limits), perhaps related
You got a Resetting dropped connection: lichess.org
2 milliseconds after the chat logs, so maybe it reset the connection before the receiving the chat message but the logs were in a different order.
In the requests docs, it suggests setting stream
to False
when using keep-alive, so that could have also played a role.
We can possibly create a pinger, that pings lichess every minute to not drop the connection.
After @arvyy mentioned the engine overshooting the movetime
paramter, I went looking through the python-chess library code. I was confused about why the engine was sent a stop
command after 12 seconds. When the play()
method for an engine is called, there is a default timeout set for movetime
plus 10 seconds (see here). That's why there's a stop
command 12 seconds after the go
command. If you remove the uci_options: go_commands: movetime
parameter from your config file, this problem should no longer happen.
One more thing: the move was never sent to lichess because the task that waits for the engine to choose a move was cancelled after the timeout expired. I don't think we should change the timeout because its purpose is to not let misbehaving engines tie up an entire process.
One more thing: the move was never sent to lichess because the task that waits for the engine to choose a move was cancelled after the timeout expired. I don't think we should change the timeout because its purpose is to not let misbehaving engines tie up an entire process.
I suppose the sensible resolution then, is to make bot forfeit the match on timeout (instead of losing on time) and maybe log a corresponding message
@arvyy I just submitted a pull request that should handle this issue. It doesn't cause the bot to resign, but it does shut down and restart the bot to allow it to attempt to finish the game. It also shows the error to the user on the console and in the log. Please try it and let me know if it works for you.
Engine responded with a move, but it wasn't played, resulting in bot losing on time. In logs I see
so the a5c5 was communicated, but it was never played, despite bot being responsive for chat commands https://lichess.org/ysYc4BEr . Using latest master commit (8deb03cb6b6e10697ae81ca2900902a3bd8e9db0)