fix races/error handling in worker SIGQUIT handler
commit5ae77e8ce4c439cdfdf1cbaee6a74fcda0b468b1
authorEric Wong <normalperson@yhbt.net>
Mon, 27 Jan 2014 16:49:14 +0000 (27 16:49 +0000)
committerEric Wong <normalperson@yhbt.net>
Wed, 29 Jan 2014 08:43:17 +0000 (29 08:43 +0000)
tree03d3838d2f20b5c35146f1ad6dba82bd165e2704
parentb3181b132f7f1e5838271f0b20df6fcbba004246
fix races/error handling in worker SIGQUIT handler

This protects us from two problems:

1) we (or our app) somehow called IO#close on one of the sockets
   we listen on without removing it from the readers array.
   We'll ignore IOErrors from IO#close and assume we wanted to
   close it.

2) our SIGQUIT handler is interrupted by itself.  This can happen as
   a fake signal from the master could be handled and a real signal
   from an outside user is sent to us (e.g. from unicorn-worker-killer)
   or if a user uses the killall(1) command.
lib/unicorn/http_server.rb