Menu

#8 SIGPIPE causes unclosed channels

open
None
7
2014-01-14
2006-01-19
Jamis Buck
No

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.

Discussion

  • Jamis Buck

    Jamis Buck - 2006-02-02

    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.

     
  • Jamis Buck

    Jamis Buck - 2006-02-02
    • priority: 5 --> 7
    • assigned_to: nobody --> obermair
     
  • Glauber

    Glauber - 2012-12-07

    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.

     
  • Glauber

    Glauber - 2014-01-14

    Yes, ignoring SIGPIPE in the script that calls balance, also fixes the problem. It should be part of the C code.

     

Log in to post a comment.