Deferred log rotation in workers
commit72ed1ceba5dbfe3656480af22740118b9e06d418
authorEric Wong <normalperson@yhbt.net>
Fri, 27 Mar 2009 07:20:24 +0000 (27 00:20 -0700)
committerEric Wong <normalperson@yhbt.net>
Fri, 27 Mar 2009 07:26:01 +0000 (27 00:26 -0700)
tree0a80fe712db8427cb6a022f63f797a34fdad222e
parent0057c878003b41efb3a53529409f16f9073f0934
Deferred log rotation in workers

Instead of rotating logs immediately when SIGUSR1 is caught,
defer it until the current client is processing is complete.

This allows multi-line log messages generated by apps to not be
broken up if SIGUSR1 is received while the app is running.

If we're sleeping inside IO.select, we close a pipe in the
exceptfds set to cause EBADF to be raised.

This also adds a small reliability improvement to test_exec
so we wait until signals are ready before sending USR1
to rotate logs.
lib/unicorn.rb
test/exec/test_exec.rb