Rust bots hang in background after Ctrl+C (Linux, SIGINT)


#1

Hello, everyone!

I suffer from the fact that after the interruption of the halite process with Ctrl+C bots remain in a neglected state (they are waiting for input) and I need to kill them separately. So, I’m wondering if there is any way to interrupt halite process together with bots processes?

Thanks.


#2

The only way I found so far is to run following:
$ killall -9 my_bot1 my_bot2 ... ; ./run_game.sh


#3

This is a bug. Signal handling in the game engine is subpar to say the least.

I also don’t like the fact the game engine uses SIGKILL to terminate the bots instead of trying SIGTERM first. I would like the bots to be able to log some final summary of the game before being terminated and SIGKILL does not allow that. Some starter kits even include signal handling - https://github.com/HaliteChallenge/Halite-III/blob/f33c5b3c498ac9d2f48bed00d4833be112b1f48f/starter_kits/Go/src/main/MyBot.go#L17