[ejabberd] s2s and c2s ping/keep-alive and "proper" shutdown
Bruce at Fitzsimons.org
Tue Oct 10 02:37:46 MSD 2006
I was struck by the ranting at http://about.psyc.eu/Jabber and inspired
to fix ejabberd to close sockets correctly
Digging into the code, yay, I see that neither s2s nor c2s connections
have any heartbeating beyond tcp timeouts. While efficient this isn't so
hot for saving fd's, giving good user feedback that their friends have
rebooted/coredumped, or closing xmpp connections "correctly". The tcp
defaults are to only send keepalives every 2 hours, the minimum per tcp
recommendations somewhere, changing them isn't always possible or a good
I see that some servers sent empty (1 whitespace) packets to force tcp
connections to either stay open (ack) or die (no ack after re-xmits).
Also helpful for keeping firewalls alive I guess, but the client can
manage that. I think I'd do that for any connection that hadn't had
traffic in <config> seconds.
As per http://www.jabber.ru/bugzilla/show_bug.cgi?id=275 I'm thinking of
a few options, but I thought I'd mention it here before doing any real
work. It doesn't look hard to add, although I'd like to take the easy
way out for s2s connections.
PS I think I'm having s2s problems with jabber.org at the moment (1.11
on my side) where conversations go one sided if I overload the pacing (I
think) by doing a copy/paste. It is pretty repeatable and no (immediate)
error messages result.
More information about the ejabberd