Page MenuHomePhabricator

Fix reconnection issue
Closed, ResolvedPublic

Description

2018-04-19 10:31:23,041 DEBUG Stwalkerster.IrcClient.IrcClient.Wikimedia.NetworkClient.Inbound - :rc-pmtpa!~rc-pmtpa@special.user QUIT :Remote host closed the connection
2018-04-19 10:31:23,042 INFO  Stwalkerster.IrcClient.IrcClient.Wikimedia - rc-pmtpa!~rc-pmtpa@special.user has left IRC.
2018-04-19 10:31:23,233 DEBUG Stwalkerster.IrcClient.IrcClient.Wikimedia.NetworkClient.Inbound - :irc.wikimedia.org NOTICE EyeInTheSkyBot :Server Terminating. Received SIGTERM
EyeInTheSky - Freenode: connected; Wikimedia: connected

Notably no error message received.

Revisions and Commits

Event Timeline

stwalkerster created this task.

The socket is being held open in CLOSE_WAIT - basically the IRC client isn't actually closing the socket fully once the connection has dropped.

To reproduce, comment out the ERROR handling in IrcClient.NetworkClientOnDataReceived (because both Freenode and LizardIRC are using nice IRCds, Wikimedia is not). Connect the bot to the network, then force a QUIT (I'm using /saquit stwtestbot :Quit: testing).

The socket won't be detected as closed until data is sent, thus the socket will remain in CLOSE_WAIT until the client decides to send a message. For EyeInTheSky, messages are never send down the Wikimedia IRC connection once the connection is established, except in reply to a PING. The only way to detect a socket is still open is to try and send something down it.

For Freenode, it's possible that the client is actually going to be sending things (as received from Wikimedia), thus this is less critical. Even so, events might not actually occur for several hours, depending on the configuration of active stalks.

For Helpmebot, there are timed events such as the !helpme category watchers, and the notifications from ACC and Elite Dangerous Journal Network. This means a dropped connection should be detected a lot sooner.