lizmat / IRC-Client

Raku module for building IRC (Internet Relay Chat) clients
Artistic License 2.0
14 stars 7 forks source link

Whateverable bots keeps reconnecting because of too eager PING watchdogs #69

Closed AlexDaniel closed 7 months ago

AlexDaniel commented 8 months ago

Right now many bots keep reconnecting because they fail to receive PINGs.

▬▬▶ _ :notable6!~not-able@ns3002604.ip-151-80-20.eu JOIN #whateverable
    ↳ PING received on 2023-11-06T02:11:33Z (after 253 seconds)
▬▬▶ 02:13:41 _ : PING copper.libera.chat
◀▬▬ _ PONG copper.libera.chat
    ↳ Scheduling next PING test for 2023-11-06T02:15:59Z (in 138 seconds)
▬▬▶ _ :AlexDaniel!~AlexDanie@62.65.220.40.cable.starman.ee PRIVMSG #whateverable ugh?
    ↳ NO PING received after 2023-11-06T02:13:41Z
    ↳ Reconnecting 130.185.232.126:6667
▬▬▶ _ Connection closed
◀▬▬ _ Attempting to connect to server

This seems wrong because bots are leaving with (Remote host closed the connection) message. I think the IRC server is keeping the connection just fine, it's just that IRC::Client panics a bit too early. Is it that 138 is too short to expect a ping?

Note that once the bot starts reconnecting, it never recovers. It also seems that bots end up in this constantly-reconnecting state right after joining.

lizmat commented 8 months ago

Version 4.0.11 of IRC::Client now in ecosystem, with a fix and an optimization.

Could you please see if this fixes the whateverable issues?

AlexDaniel commented 7 months ago

Seems to be resolved now!