SIGPIPE causes unclosed channels
Brought to you by:
inlabnetworks,
obermair
If a SIGPIPE occurs in a child (when the child tries to
read from a closed socket, for instance), the child
will die without having a chance to update it's stats
in shared memory. This means that if you are
restricting a channel to a single connection at a time,
the channel becomes permanently marked as busy if the
child dies.
Ignoring SIGPIPE seems to have fixed this problem for
me, since select will return -1 instead and will cause
the child to exit cleanly.
Logged In: YES
user_id=31832
Just a follow-up--we've had this fix in place for a few
weeks and balance has worked flawlessly for us. We used to
have to restart it every day or two, but it has run without
interruption since this ticket was opened. The only change
we made was to add signal(SIGPIPE, SIG_IGN) after a new
child is forked.
I'm noticing a few "ghost" connections - reported in the "c" column in the "show" display, but non-existent (not visible in netstat). I think this may be the cause.
Yes, ignoring SIGPIPE in the script that calls balance, also fixes the problem. It should be part of the C code.