lykos
lykos copied to clipboard
Automatically reconnect after netsplit
Right now we just leave the process hanging after a split when we detect a broken pipe error. This means you have to log into cli, Ctrl+C the process, and then start it up again. We should instead attempt to automatically reconnect on broken pipe:
- Perhaps have a grace or cooldown period where we wait before reconnecting, so that we don't flood the IRC server with connections in the event it's under a DOS or down. Also so we don't flood the error log.
- Dunno if we should reconnect in the same proc or if we should kill the proc and restart (aka internally issue an !frestart on a broken pipe)
I was thinking of keeping the same process and just reconnecting to the server. That way, games or anything else going on would continue. But in the case of an actual net split, the game is probably ruined ... so perhaps it should kill any running game after the restart (it's still the same process, so it could report who was what)
https://gist.github.com/kuzetsa/5ab1adc2998913bd27d0e8247e7e8194
^ thanks, if this issues doesn't actually go away, should I open a new issue or comment on this one?
Edit / new remark:
Oh, this issue is theoretically going to be closed once there's some commits (and/or testing) to fix the problem, I think?
Either way is fine - just let me know if there's a preference for what should happen if there's further buggy "not sanely handling netsplits" etc. etc. etc.
Well i don't think it's just net splits.. I had mine ping out in the past it never did reconnect till I restarted it
Can't debug what I'm no longer running / I won't follow up up on this github issue.
(haven't been running a bot in months due to lack of activity in the channel)