IRC connections never times out
See original GitHub issueJust reported by @MaxLeiter on IRC and isolated on a test server. When the remote server we are connected to just disappears and doesn’t close the connection (server going down, IP gets blackholed, or other network issues), The Lounge stays connected forever and the connection never times out. It still continues to work just as if the connection was working fine, except nothing really gets sent and nothing is coming back in.
Easy way to test on Linux: iptables -A INPUT -s xx.xx.xx.xx -j DROP
(iptables -D INPUT 1
to remove, assuming an empty iptables chain) so the client never receives the RST packet. Then wait. The client is permanently stuck waiting for something, with no indication that we are disconnected.
A possible fix could be to automatically close the connection if we didn’t receive a PING
request from the server in say, 5 minutes. Another is to periodically send pings to the server ourselves, and kill the connection ourselves if we don’t get a reply in 10-30 seconds (seriously, anything higher is really insane considering it takes 300ms to reach the other side of the world).
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Server ping/pong is handled just fine, thus the server knows we’re alive. The suggestion is to send periodic PINGs to the server, so that we can make sure the server is alive.
kiwiirc/irc-framework#35 merged 😃