about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2010-12-03unicorn 3.0.1 - one bugfix for Rainbows! v3.0.1
...and only Rainbows! This release fixes HTTP pipelining for requests with bodies for users of synchronous Rainbows! concurrency models. Since Unicorn itself does not support keepalive nor pipelining, Unicorn-only users need not upgrade.
2010-12-02stream_input: avoid trailer parsing on unchunked requests
It screws up keepalive for Rainbows! requests with a body.
2010-11-20unicorn 3.0.0 - disable rewindable input! v3.0.0
Rewindable "rack.input" may be disabled via the "rewindable_input false" directive in the configuration file. This will violate Rack::Lint for Rack 1.x applications, but can reduce I/O for applications that do not need a rewindable input. This release updates us to the Kgio 2.x series which should play more nicely with other libraries and applications. There are also internal cleanups and improvements for future versions of Rainbows! The Unicorn 3.x series supercedes the 2.x series while the 1.x series will remain supported indefinitely.
2010-11-20stream_input: use String#sub! instead of gsub!
There's no difference because of the \A anchor, but sub! is doesn't loop so it's simpler.
2010-11-20stream_input: small cleanups and fixes
No need to accept any number of args, that could hide bugs in applications that could give three or more arguments. We also raise ArgumentError when given a negative length argument to read.
2010-11-19unicorn 3.0.0pre2 - less bad than 2.x or 3.0.0pre1! v3.0.0pre2
This release updates us to the Kgio 2.x series which should play more nicely with other applications. There are also bugfixes from the 2.0.1 release and a small bugfix to the new StreamInput class. The Unicorn 3.x series will supercede the 2.x series while the 1.x series will remain supported indefinitely.
2010-11-18stream_input: read with zero length returns ''
Any calls to read with an explicit zero length now returns an empty string. While not explicitly specified by Rack::Lint, this is for compatibility with StringIO and IO methods which are common in other web servers.
2010-11-17http_server: fix HttpParserError constant resolution
"Unicorn" is no longer in the default constant resolution namespace.
2010-11-16unicorn 3.0.0pre1 v3.0.0pre1
Rewindable "rack.input" may be disabled via the "rewindable_input false" directive in the configuration file. This will violate Rack::Lint for Rack 1.x applications, but can reduce I/O for applications that do not need it. There are also internal cleanups and enhancements for future versions of Rainbows! Eric Wong (11): t0012: fix race condition in reload enable HTTP keepalive support for all methods http_parser: add HttpParser#next? method tee_input: switch to simpler API for parsing trailers switch versions to 3.0.0pre add stream_input class and build tee_input on it configurator: enable "rewindable_input" directive http_parser: ensure keepalive is disabled when reset *_input: make life easier for subclasses/modules tee_input: restore read position after #size preread_input: no-op for non-rewindable "rack.input"
2010-11-16preread_input: no-op for non-rewindable "rack.input"
We may get "rack.input" objects that are not rewindable in the future, so be prepared for those and do no harm.
2010-11-13tee_input: restore read position after #size
It's possible for an application to call size after it has read a few bytes/lines, so do not screw up a user's read offset when consuming input.
2010-11-12*_input: make life easier for subclasses/modules
Avoid having specific knowledge of internals in TeeInput and instead move that to StreamInput when dealing with byte counts. This makes things easier for Rainbows! which will need to extends these classes.
2010-11-11configurator: enable "rewindable_input" directive
This allows users to override the current Rack spec and disable the rewindable input requirement. This can allow applications to use less I/O to minimize the performance impact when processing uploads.
2010-11-11add stream_input class and build tee_input on it
We will eventually expose a Unicorn::StreamInput object as "rack.input" for Rack 2.x applications. StreamInput allows applications to avoid buffering input to disk, removing the (potentially expensive) rewindability requirement of Rack 1.x. TeeInput is also rewritten to build off StreamInput for simplicity. The only regression is that TeeInput#rewind forces us to consume an unconsumed stream before returning, a negligible price to pay for decreased complexity.
2010-11-11switch versions to 3.0.0pre
Here are major, incompatible internal API changes.
2010-11-07tee_input: switch to simpler API for parsing trailers
Not that anybody uses trailers extensively, but it's good to know it's there.
2010-10-27unicorn 2.0.0 - mostly internal cleanups v2.0.0
Despite the version number, this release mostly features internal cleanups for future versions of Rainbows!. User visible changes include reductions in CPU wakeups on idle sites using high timeouts. Barring possible portability issues due to the introduction of the kgio library, this release should be ready for all to use. However, 1.1.x (and possibly 1.0.x) will continue to be maintained. Unicorn 1.1.5 and 1.0.2 have also been released with bugfixes found during development of 2.0.0.
2010-10-27configurator: reloading with unset values restores default
If a configuration directive is set at startup and later unset, it correctly restores the original default value as if it had never been set in the first place. This applies to the majority of the configuration values with a few exceptions: * This only applies to stderr_path and stdout_path when daemonized (the usual case, they'll be redirected to "/dev/null"). When NOT daemonized, we cannot easily redirect back to the original stdout/stderr destinations. * Unsetting working_directory does not restore the original working directory where Unicorn was started. As far as we can tell unsetting this after setting it is rarely desirable and greatly increases the probability of user error.
2010-10-27configurator: use "__send__" instead of "send"
It's less ambiguous since this is a network server after all.
2010-10-27configurator: switch to normal class
No point in using a Struct for (1.8) space-efficiency if there's only one of them.
2010-10-27reduce master process wakeups
To reduce CPU wakeups and save power during off hours, we can precalculate a safe amount to sleep before killing off idle workers.
2010-10-26master: remove limit on queued signals
If a moronic sysadmin is sending too many signals, just let them do it. It's likely something is terribly wrong when the server is overloaded with signals, so don't try to protect users from it. This will also help in case where TTOU signals are sent too quickly during shutdown, although sleeping between kill(2) syscalls is always a good idea because of how non-real-time signals are delivered.
2010-10-09unicorn 2.0.0pre3 - more small fixes v2.0.0pre3
There is a new Unicorn::PrereadInput middleware to which allows input bodies to be drained off the socket and buffered to disk (or memory) before dispatching the application. HTTP Pipelining behavior is fixed for Rainbows! There are some small Kgio fixes and updates for Rainbows! users as well.
2010-10-09add PrereadInput middleware to get around TeeInput
This may be useful for some apps that wish to drain the body before acquiring an app-wide lock. Maybe it's more useful with Rainbows!...
2010-10-07unicorn 2.0.0pre2 - releases are cheap v2.0.0pre2
Internal changes/cleanups for Rainbows!
2010-10-07start using more compact parser API
This should be easier for Rainbows! to use
2010-10-07http_server: avoid method redefinition warnings
We clobber the accessor methods.
2010-10-06unicorn 2.0.0pre1 - a boring "major" release v2.0.0pre1
Mostly internal cleanups for future versions of Rainbows! and people trying out Rubinius. There are tiny performance improvements for Ruby 1.9.2 users which may only be noticeable with Rainbows! Unicorn 1.1.x users are NOT required to upgrade.
2010-10-06various cleanups and reduce indentation
This also affects some constant scoping rules, but hopefully makes things easier to follow. Accessing ivars (not via accessor methods) are also slightly faster, so use them in the criticial process_client code path.
2010-10-05upgrade to kgio 1.2.0
This provides the kgio_read! method which is like readpartial, only significantly cheaper when a client disconnects on us.
2010-10-05tee_input: use kgio to avoid stack traces on EOF
TeeInput methods may be invoked deep in the stack, so avoid giving them more work to do if a client disconnects due to a bad upload.
2010-10-05tmpio: use super instead of an explicit method
This is for compatibility with Ruby implementations such as Rubinius that use "IO.new" internally inside "IO.open"
2010-10-05update comment about non-blocking accept()
Thanks to kgio, we no longer use accept_nonblock.
2010-10-05util: uindent use less ambiguous constant scoping
This hopefully makes things easier to read and follow.
2010-10-05Unicorn::Util.tmpio => Unicorn::TmpIO.new
This is slightly shorter and hopefully easier to find.
2010-10-05start using kgio, the kinder, gentler I/O library
This should hopefully make the non-blocking accept() situation more tolerable under Ruby 1.9.2.
2010-10-04http_request: reformat and small reorg
This hides more HTTP request logic inside our object.
2010-10-04tee_input: update interface to use HttpRequest
This should ensure we have less typing to do.
2010-10-04http_request: avoid globals
Rainbows! will be able to reuse this.
2010-10-04split out worker to a separate file
This hopefully makes things easier to read, follow, and find since it's mostly documentation...
2010-10-04http_response: avoid singleton method
There's no need for a response class or object since Rack just uses an array as the response. So use a procedural style which allows for easier understanding. We shall also support keepalive/pipelining in the future, too.
2010-10-04avoid unlinking actively listening sockets
While we've always unlinked dead sockets from nuked/leftover processes, blindly unlinking them can cause unnecessary failures when an active process is already listening on them. We now make a simple connect(2) check to ensure the socket is not in use before unlinking it. Thanks to Jordan Ritter for the detailed bug report leading to this fix. ref: http://mid.gmane.org/8D95A44B-A098-43BE-B532-7D74BD957F31@darkridge.com
2010-08-30remove nasty ugly hacks at startup
These nasty hacks were breaking Rubinius compatibility. This can be further cleaned up, too.
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-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-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
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.