lykos icon indicating copy to clipboard operation
lykos copied to clipboard

Automatically reconnect after netsplit

Open skizzerz opened this issue 7 years ago • 4 comments

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:

  1. 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.
  2. 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)

skizzerz avatar Jun 21 '17 04:06 skizzerz

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)

jacob1 avatar Jun 21 '17 04:06 jacob1

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.

kuzetsa avatar Jun 21 '17 05:06 kuzetsa

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

Fudster avatar Feb 07 '18 07:02 Fudster

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)

kuzetsa avatar Feb 07 '18 18:02 kuzetsa