about summary refs log tree commit homepage
DateCommit message (Collapse)
2010-08-28unicorn 1.1.3 - small bug fixes v1.1.3
This release fixes race conditions during SIGUSR1 log cycling. This bug mainly affects Rainbows! users serving static files, but some Rack apps use threads internally even under Unicorn. Other small fixes: * SIGTTIN works as documented after SIGWINCH * --help output from `unicorn` and `unicorn_rails` is more consistent
2010-08-28make log reopens even more robust in threaded apps
A follow-up to 4b23693b9082a84433a9e6c1f358b58420176b27 If multithreaded programming can be compared to juggling chainsaws, then multithreaded programming with signal handlers in play is akin to juggling chainsaws on a tightrope over shark-infested waters. (cherry picked from commit feab35fe531843066db3418598874cf9f9419614)
2010-08-28make log reopens even more robust in threaded apps
A follow-up to 4b23693b9082a84433a9e6c1f358b58420176b27 If multithreaded programming can be compared to juggling chainsaws, then multithreaded programming with signal handlers in play is akin to juggling chainsaws on a tightrope over shark-infested waters.
2010-08-28update Rails3 tests to use 3.0.0rc2
No code changes needed, thankfully. (cherry picked from commit 18968f6aff2fa5ba5a7e3e3d47c9cc05cd6c260d)
2010-08-28update Rails3 tests to use 3.0.0rc2
No code changes needed, thankfully.
2010-08-28make log reopens more robust in multithreaded apps
IOError may occur due to race conditions as another thread may close the file immediately after we call File#closed? to check. Errno::EBADF may occur in some applications that close a file descriptor without notifying Ruby (or if two IO objects refer to the same descriptor, possibly one of them using IO#for_fd). (cherry picked from commit 4b23693b9082a84433a9e6c1f358b58420176b27)
2010-08-28bin/*: more consistent --help output
This fixes a long-standing bug in the output of "unicorn_rails" where the program name was missing. (cherry picked from commit 096afc1a8e958cc09b4ce8b3bfe76ce056c7ed69)
2010-08-28make log reopens more robust in multithreaded apps
IOError may occur due to race conditions as another thread may close the file immediately after we call File#closed? to check. Errno::EBADF may occur in some applications that close a file descriptor without notifying Ruby (or if two IO objects refer to the same descriptor, possibly one of them using IO#for_fd).
2010-08-24bin/*: more consistent --help output
This fixes a long-standing bug in the output of "unicorn_rails" where the program name was missing.
2010-08-07miscellaneous loop and begin cleanups
These are minor changes to remove unnecessary loop nesting and begin usage to reduce our code size and hopefully simplify flow for readers.
2010-08-07log ERROR messages if workers exit with failure
Something is wrong if workers exit with a non-zero status, so we'll increase the log level to help prevent people from missing it.
2010-07-16SIGTTIN works after SIGWINCH
In addition to SIGHUP, it should be possible to gradually bring workers back up (to avoid overloading the machine) when rolling back upgrades after SIGWINCH. Noticed-by: Lawrence Pit ref: http://mid.gmane.org/4C3F8C9F.2090903@gmail.com (cherry picked from commit f1d33c80dd6c5650f960f7087f4e08f809754d34)
2010-07-16SIGTTIN works after SIGWINCH
In addition to SIGHUP, it should be possible to gradually bring workers back up (to avoid overloading the machine) when rolling back upgrades after SIGWINCH. Noticed-by: Lawrence Pit ref: http://mid.gmane.org/4C3F8C9F.2090903@gmail.com
2010-07-13Merge branch '1.1.x-stable'
* 1.1.x-stable: (27 commits) unicorn 1.1.2 - fixing upgrade rollbacks unicorn 1.0.1 - bugfixes only SIGHUP deals w/ dual master pid path scenario launcher: do not re-daemonize when USR2 upgrading SIGHUP deals w/ dual master pid path scenario launcher: do not re-daemonize when USR2 upgrading unicorn 1.1.1 - fixing cleanups gone bad :x tee_input: fix constant resolution for client EOF unicorn 1.1.0 - small changes and cleanups cleanup "stringio" require tee_input: safer record separator ($/) handling prefer "[]" to "first"/"last" where possible tee_input: safer record separator ($/) handling socket_helper: disable documentation socket_helper: cleanup FreeBSD accf_* detection socket_helper: no reason to check for logger method configurator: cleanup RDoc, un-indent configurator: documentation for new accept options socket_helper: move defaults to the DEFAULTS constant doc: recommend absolute paths for -c/--config-file ...
2010-07-13unicorn 1.1.2 - fixing upgrade rollbacks v1.1.2
This release is fixes a long-standing bug where the original PID file is not restored when rolling back from a USR2 upgrade. Presumably most upgrades aren't rolled back, so it took over a year to notice this issue. Thanks to Lawrence Pit for discovering and reporting this issue.
2010-07-13Merge commit 'v1.0.1' into 1.1.x-stable
* commit 'v1.0.1': unicorn 1.0.1 - bugfixes only SIGHUP deals w/ dual master pid path scenario launcher: do not re-daemonize when USR2 upgrading tee_input: safer record separator ($/) handling
2010-07-13unicorn 1.0.1 - bugfixes only v1.0.1
The first maintenance release of 1.0.x, this release is primarily to fix a long-standing bug where the original PID file is not restored when rolling back from a USR2 upgrade. Presumably most upgrades aren't rolled back, so it took over a year to notice this issue. Thanks to Lawrence Pit for discovering and reporting this issue. There is also a pedantic TeeInput bugfix which shouldn't affect real apps from the 1.1.x series and a test case fix for OSX, too.
2010-07-13SIGHUP deals w/ dual master pid path scenario
As described in our SIGNALS documentation, sending SIGHUP to the old master (to respawn SIGWINCH-ed children) while the new master (spawned from SIGUSR2) is active is useful for backing out of an upgrade before sending SIGQUIT to the new master. Unfortunately, the SIGHUP signal to the old master will cause the ".oldbin" pid file to be reset to the non-".oldbin" version and thus attempt to clobber the pid file in use by the to-be-terminated new master process. Thanks to the previous commit to prevent redaemonization in the new master, the old master can reliably detect if the new master is active while it is reloading the config file. Thanks to Lawrence Pit for discovering this bug. ref: http://mid.gmane.org/4C3BEACF.7040301@gmail.com (cherry picked from commit c13bec3449396b21795966101367838161612d61)
2010-07-13launcher: do not re-daemonize when USR2 upgrading
This was accidentally enabled when ready_pipe was developed. While re-daemonizing appears harmless in most cases this makes detecting backed-out upgrades from the original master process impossible. (cherry picked from commit 3f0f9d6d72cf17b34c130b86eb933bbc513b24b3)
2010-07-13SIGHUP deals w/ dual master pid path scenario
As described in our SIGNALS documentation, sending SIGHUP to the old master (to respawn SIGWINCH-ed children) while the new master (spawned from SIGUSR2) is active is useful for backing out of an upgrade before sending SIGQUIT to the new master. Unfortunately, the SIGHUP signal to the old master will cause the ".oldbin" pid file to be reset to the non-".oldbin" version and thus attempt to clobber the pid file in use by the to-be-terminated new master process. Thanks to the previous commit to prevent redaemonization in the new master, the old master can reliably detect if the new master is active while it is reloading the config file. Thanks to Lawrence Pit for discovering this bug. ref: http://mid.gmane.org/4C3BEACF.7040301@gmail.com (cherry picked from commit c13bec3449396b21795966101367838161612d61)
2010-07-13launcher: do not re-daemonize when USR2 upgrading
This was accidentally enabled when ready_pipe was developed. While re-daemonizing appears harmless in most cases this makes detecting backed-out upgrades from the original master process impossible. (cherry picked from commit 3f0f9d6d72cf17b34c130b86eb933bbc513b24b3)
2010-07-13SIGHUP deals w/ dual master pid path scenario
As described in our SIGNALS documentation, sending SIGHUP to the old master (to respawn SIGWINCH-ed children) while the new master (spawned from SIGUSR2) is active is useful for backing out of an upgrade before sending SIGQUIT to the new master. Unfortunately, the SIGHUP signal to the old master will cause the ".oldbin" pid file to be reset to the non-".oldbin" version and thus attempt to clobber the pid file in use by the to-be-terminated new master process. Thanks to the previous commit to prevent redaemonization in the new master, the old master can reliably detect if the new master is active while it is reloading the config file. Thanks to Lawrence Pit for discovering this bug. ref: http://mid.gmane.org/4C3BEACF.7040301@gmail.com
2010-07-13launcher: do not re-daemonize when USR2 upgrading
This was accidentally enabled when ready_pipe was developed. While re-daemonizing appears harmless in most cases this makes detecting backed-out upgrades from the original master process impossible.
2010-07-11unicorn 1.1.1 - fixing cleanups gone bad :x v1.1.1
Unicorn::TeeInput constant resolution for Unicorn::ClientError got broken simplifying code for RDoc. This affects users of Rainbows! and Zbatery.
2010-07-11tee_input: fix constant resolution for client EOF
Noticed while hacking on a Zbatery-using application (cherry picked from commit ac15513bb81a345cd12c67702a81a585b8b0514e)
2010-07-11tee_input: fix constant resolution for client EOF
Noticed while hacking on a Zbatery-using application
2010-07-08unicorn 1.1.0 - small changes and cleanups v1.1.0
This is a small, incremental feature release with some internal changes to better support upcoming versions of the Rainbows! and Zbatery web servers. There is no need to upgrade if you're happy with 1.0.0, but also little danger in upgrading. There is one pedantic bugfix which shouldn't affect anyone and small documentation updates as well.
2010-07-08cleanup "stringio" require
"stringio" is part of the Ruby distro and we use it in multiple places, so avoid re-requiring it. (cherry picked from commit 0fea004ab093ec4f59d919915a505a136326bd8a)
2010-07-08cleanup "stringio" require
"stringio" is part of the Ruby distro and we use it in multiple places, so avoid re-requiring it.
2010-07-08tee_input: safer record separator ($/) handling
Different threads may change $/ during execution, so cache it at function entry to a local variable for safety. $/ may also be of a non-binary encoding, so rely on Rack::Utils.bytesize to portably capture the correct size. Our string slicing is always safe from 1.9 encoding: both our socket and backing temporary file are opened in binary mode, so we'll always be dealing with binary strings in this class (in accordance to the Rack spec). (cherry picked from commit 1cd698f8c7938b1f19e9ba091708cb4515187939)
2010-07-08prefer "[]" to "first"/"last" where possible
"[]" is slightly faster under Ruby 1.9 (but slightly slower under 1.8). (cherry picked from commit 5ece8c1c33f10e6496dfe5ae1d0d368293278d2d)
2010-07-08tee_input: safer record separator ($/) handling
Different threads may change $/ during execution, so cache it at function entry to a local variable for safety. $/ may also be of a non-binary encoding, so rely on Rack::Utils.bytesize to portably capture the correct size. Our string slicing is always safe from 1.9 encoding: both our socket and backing temporary file are opened in binary mode, so we'll always be dealing with binary strings in this class (in accordance to the Rack spec). (cherry picked from commit 1cd698f8c7938b1f19e9ba091708cb4515187939)
2010-07-08prefer "[]" to "first"/"last" where possible
"[]" is slightly faster under Ruby 1.9 (but slightly slower under 1.8).
2010-07-08tee_input: safer record separator ($/) handling
Different threads may change $/ during execution, so cache it at function entry to a local variable for safety. $/ may also be of a non-binary encoding, so rely on Rack::Utils.bytesize to portably capture the correct size. Our string slicing is always safe from 1.9 encoding: both our socket and backing temporary file are opened in binary mode, so we'll always be dealing with binary strings in this class (in accordance to the Rack spec).
2010-07-06socket_helper: disable documentation
(cherry picked from commit 98c51edf8b6f031a655a93b52808c9f9b78fb6fa)
2010-07-06socket_helper: cleanup FreeBSD accf_* detection
Instead of detecting at startup if filters may be used, just try anyways and log the error. It is better to ask for forgiveness than permission :) (cherry picked from commit 2b4b15cf513f66dc7a5aabaae4491c17895c288c)
2010-07-06socket_helper: no reason to check for logger method
We only use this module in HttpServer and our unit test mocks it properly. (cherry picked from commit e0ea1e1548a807d152c0ffc175915e98addfe1f2)
2010-07-06configurator: cleanup RDoc, un-indent
No point in redeclaring the Unicorn module in here. (cherry picked from commit e4d2c7c302e96ee504d82376885ac6b1897c666a)
2010-07-06configurator: documentation for new accept options
The defaults should be reasonable, but there may be folks who want to experiment. (cherry picked from commit 686281a90a9b47bac4dfd32a72a97e6e8d26afa1)
2010-07-06socket_helper: move defaults to the DEFAULTS constant
This is to allow Rainbows! to override the defaults. (cherry picked from commit ef8f888ba1bacc759156f7336d39ba9b947e3f9d)
2010-07-06doc: recommend absolute paths for -c/--config-file
Suggested-by: Jeremy Evans ref: http://mid.gmane.org/AANLkTintT4vHGEdueuG45_RwJqFCToHi5pm2-WKDSUMz@mail.gmail.com (cherry picked from commit d7695c25c5e3b1c90e63bf15a5c5fdf68bfd0c34)
2010-07-06socket_helper: tunables for tcp_defer_accept/accept_filter
Under Linux, this allows users to tune the time (in seconds) to defer connections before allowing them to be accepted. The behavior of TCP_DEFER_ACCEPT changed with Linux 2.6.32 and idle connections may still be accept()-ed after the specified value in seconds. A small value of '1' remains the default for Unicorn as Unicorn does not worry about slow clients. Higher values provide better DoS protection for Rainbows! but also increases kernel memory usage. Allowing "dataready" for FreeBSD accept filters will allow SSL sockets to be used in the future for HTTPS, too. (cherry picked from commit 646cc762cc9297510102fc094f3af8a5a9e296c7)
2010-07-06http_response: this should be a module, not a class
This affects Rainbows!, but Rainbows! is still using the Unicorn 1.x branch. While we're at it, avoid redeclaring the "Unicorn" module, it makes documentation noisier. (cherry picked from commit 5769f313793ca84100f089b1911f2e22d0a31e9d)
2010-07-06http: avoid (re-)declaring the Unicorn module
It makes for messy documentation. (cherry picked from commit b8b979d75519be1c84818f32b83d85f8ec5f6072)
2010-07-06tee_input: undent, avoid (re)-declaring "module Unicorn"
It makes RDoc look better and cleaner, since we don't do anything in the Unicorn namespace. (cherry picked from commit 6f720afd95d8131a2657c643b97cb18c750ed9f8)
2010-07-06tee_input: allow tuning of client_body_buffer_size/io_size
Some folks may require more fine-grained control of buffering and I/O chunk sizes, so we'll support them (unofficially, for now). (cherry picked from commit 9f48be69bfe579dab02b5fe8d6e728ae63fd24fc)
2010-07-06tee_input: (nitpick) use IO#rewind instead of IO#seek(0)
no need to pass an extra argument (cherry picked from commit 1a49a8295054a2e931f5288540acb858be8edcc8)
2010-07-06socket_helper: disable documentation for internals
2010-07-06socket_helper: cleanup FreeBSD accf_* detection
Instead of detecting at startup if filters may be used, just try anyways and log the error. It is better to ask for forgiveness than permission :)
2010-07-06socket_helper: no reason to check for logger method
We only use this module in HttpServer and our unit test mocks it properly.