LP#1494486: Limit damage caused by dropped drone XMPP sockets user/miker/lp-1494486-die-on-send-failure
authorMike Rylander <mrylander@gmail.com>
Thu, 10 Sep 2015 20:56:13 +0000 (16:56 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 10 Sep 2015 20:56:13 +0000 (16:56 -0400)
commit70dcd3e61d38d945f041912d0d9609d2fc51957b
treedead6c1b34fed45783b3c5b01ed71d02ba39ff70
parent33a5e60ee8f4c539d5bf3dc1d1ff1b62d5715d65
LP#1494486: Limit damage caused by dropped drone XMPP sockets

It is apparently possible for drones to get into a state where their XMPP
socket is closed but they don't notice. This is bad because the drone can
continue to receive requests from its listener but can no longer respond
to them. To limit the pain this can cause, we should kill the drone as soon
as we notice this condition.

To avoid overhead, this commit notices when the socket returns an error (or
raises a signal, in Perl) upon write, and exits immediately.  One message
will be lost, but the drone will no longer be a black hole that does nothing
but absorb requests it can never fill.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
src/libopensrf/osrf_app_session.c
src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm