about summary refs log tree commit homepage
DateCommit message (Collapse)
2011-08-25unicorn 4.1.1 - fix last-resort timeout accuracy v4.1.1
The last-resort timeout mechanism was inaccurate and often delayed in activation since the 2.0.0 release. It is now fixed and remains power-efficient in idle situations, especially with the wakeup reduction in MRI 1.9.3+. There is also a new document on application timeouts intended to discourage the reliance on this last-resort mechanism. It is visible on the web at: http://unicorn.bogomips.org/Application_Timeouts.html
2011-08-24doc: add Application Timeouts document
Hopefully this leads to fewer worker processes being killed.
2011-08-23test_helper: remove needless LOAD_PATH mangling
We do it in the Ruby invocation or RUBYLIB.
2011-08-23fix sleep/timeout activation accuracy
I've noticed in stderr logs from some folks that (last resort) timeouts from the master process are taking too long to activate due to the workarounds for suspend/hibernation.
2011-08-22.document: re-add OobGC documentation
Oops!
2011-08-20unicorn 4.1.0 - small updates and fixes v4.1.0
* Rack::Chunked and Rack::ContentLength middlewares are loaded by default for RACK_ENV=(development|deployment) users to match Rack::Server behavior. As before, use RACK_ENV=none if you want fine-grained control of your middleware. This should also help users of Rainbows! and Zbatery. * CTL characters are now rejected from HTTP header values * Exception messages are now filtered for [:cntrl:] characters since application/middleware authors may forget to do so * Workers will now terminate properly if a SIGQUIT/SIGTERM/SIGINT is received while during worker process initialization. * close-on-exec is explicitly disabled to future-proof against Ruby 2.0 changes [ruby-core:38140]
2011-08-20rdoc cleanups
2011-08-19close race if an exit signal hits the worker before trap
The signal handler from the master is still active and will push the pending signal to SIG_QUEUE if a worker receives a signal immediately after forking.
2011-08-19gemspec: bump wrongdoc dependency for dev
Hopefully it points people towards the mailing list
2011-08-19tests: bump test deps to the latest versions
Nothing appears broken :)
2011-08-19Rack::Chunked and ContentLength middlewares by default
This is needed to match the behavior of Rack::Server for RACK_ENV=(deployment|development), actually. This won't affect users of other RACK_ENV values. This change has minor performance consequences, so users negatively affected should set RACK_ENV to "none" instead for full control of their middleware stack. This mainly affects Rainbows!/Zbatery users since they have persistent connections and /need/ Content-Length or Transfer-Encoding:chunked headers.
2011-08-19filter exception messages with control characters
We do not want to affect terminals of users who view our log files.
2011-08-11http_server: small simplification for redirects
We only need the fileno in the key which we use to generate the UNICORN_FD env. Otherwise the IO object is accepted and understood by Ruby.
2011-08-11future-proof against close-on-exec by default
Setting the close-on-exec flag by default and closing non-standard descriptors is proposed for Ruby 1.9.4/2.0.0. Since Unicorn is one of the few apps to rely on FD inheritance across exec(), we need to workaround this by redirecting each listener FD to itself for Kernel#exec. Ruby supports a hash as the final argument to Kernel#exec since at least 1.9.1 (nobody cares for 1.9.0 anymore). This allows users to backport close-on-exec by default patches to older 1.9.x installs without breaking anything. ref: http://redmine.ruby-lang.org/issues/5041
2011-08-11test_socket_helper: Socket#bind may fail with EINVAL if IPv6 is missing
I don't build IPv6 into all my kernels; maybe other testers do not, either.
2011-08-03KNOWN_ISSUES: add link to FreeBSD jail workaround notes
Thanks to Tatsuya Ono on the unicorn mailing list.
2011-08-02trap death signals in the worker sooner
This helps close a race condition preventing shutdown if loading the application (preload_app=false) takes a long time and the user decides to kil workers instead.
2011-07-20http_server: explicitly disable close-on-exec for listeners
Future versions of Ruby may change this from the default *nix behavior, so we need to explicitly allow FD passing via exec(). ref: http://redmine.ruby-lang.org/issues/5041
2011-07-13http: reject non-LWS CTL chars (0..31 + 127) in field values
RFC 2616 doesn't appear to allow most CTL bytes even though Mongrel always did. Rack::Lint disallows 0..31, too, though we allow "\t" (HT, 09) since it's LWS and allowed by RFC 2616.
2011-07-01socket_helper: fix undefined variable for logging
I corrupted a Ruby build and SOL_TCP didn't get defined :x
2011-06-29unicorn 4.0.1 - regression bugfixes v4.0.1
This release fixes things for users of per-worker "listen" directives in the after_fork hook. Thanks to ghazel@gmail.com for reporting the bug. The "timeout" configurator directive is now truncated to 0x7ffffffe seconds to prevent overflow when calling IO.select.
2011-06-29configurator: limit timeout to 32-bit INT_MAX-1
Nobody will miss one second if they specify an "infinite" timeout of ~68 years. This prevents duplicating this logic in Rainbows!
2011-06-29fix per-worker listen directive in after_fork hook
The testcase for this was broken, too, so we didn't notice this :< Reported-by: ghazel@gmail.com on the Rainbows! mailing list, http://mid.gmane.org/BANLkTi=oQXK5Casq9SuGD3edeUrDPvRm3A@mail.gmail.com
2011-06-27configurator: truncate timeouts to 32-bit LONG_MAX
IO.select in Ruby can't wait longer than this. This means Unicorn can't support applications that take longer than 68 years to respond :(
2011-06-27unicorn 4.0.0 - for mythical hardware! v4.0.0
A single Unicorn instance may manage more than 1024 workers without needing privileges to modify resource limits. As a result of this, the "raindrops"[1] gem/library is now a required dependency. TCP socket defaults now favor low latency to mimic UNIX domain socket behavior (tcp_nodelay: true, tcp_nopush: false). This hurts throughput, users who want to favor throughput should specify "tcp_nodelay: false, tcp_nopush: true" in the listen directive. Error logging is more consistent and all lines should be formatted correctly in backtraces. This may break the behavior of some log parsers. The call stack is smaller and thus easier to examine backtraces when debugging Rack applications. There are some internal API changes and cleanups, but none that affect applications designed for Rack. See "git log v3.7.0.." for details. For users who cannot install kgio[2] or raindrops, Unicorn 1.1.x remains supported indefinitely. Unicorn 3.x will remain supported if there is demand. We expect raindrops to introduce fewer portability problems than kgio did, however. [1] http://raindrops.bogomips.org/ [2] http://bogomips.org/kgio/
2011-06-27slightly faster worker process spawning
It's still O(n) since we don't maintain a reverse mapping of spawned processes, but at least we avoid the extra overhead of creating an array every time.
2011-06-25reenable heartbeat checking for idle workers
Some applications/libraries may launch background threads which can lock up the process. So we can't disable heartbeat checking just because the main thread is sleeping. This also has the side effect of reducing master process wakeups when all workers are idle.
2011-06-24test with latest kgio and rack versions
We'll continue to support older versions, but make sure things on the latest ones work.
2011-06-24allow multiline comments in config.ru
This matches the latest Rack behavior. We can't just use Rack::Builder.parse_file because our option parser logic is slightly different and incompatible. ref: rack commit d31cf2b7c0c77c04510c08d95776315ceb24ba54
2011-06-23http_server: avoid race conditions on SIGQUIT
We don't want the Worker#tick= assignment to trigger after we accept a client, since we'd drop that request when we raise the exception that breaks us out of the worker loop. Also, we don't want to enter IO.select with an empty LISTENERS array so we can fail with IOError or Errno::EBADF.
2011-06-22http_server: remove unused variable
A leftover from the fchmod() days
2011-06-22gemspec: fix raindrops dependency
Oops, I suck at Ruby :x
2011-06-22TODO: remove scalability to >= 1024 workers item
We can do it!
2011-06-17test_http_parser: fix for URI too long errors (#3)
The random garbage generator may occasionally generate URIs that are too long and cause the URI-specific error to be raised instead of the generic parser error we recently introduced. Follow-up-to: commit 742c4d77f179a757dbcb1fa350f9d75b757acfc7
2011-06-17error logging is more consistent
Backtraces are now formatted properly (with timestamps) and exceptions will be logged more consistently and similar to Logger defaults: "#{exc.message} (#{e.class})" backtrace.each { |line| ... } This may break some existing monitoring scripts, but errors will be more standardized and easier to check moving forward.
2011-06-17add broken app test from Rainbows!
"app error" is more correct, and consistent with Rainbows!
2011-06-17ensure at_exit handlers run on graceful shutdown
rescuing from SystemExit and exit()-ing again is ugly, but changes made to lower stack depth positively affect _everyone_ so we'll tolerate some ugliness here. We'll need to disable graceful exit for some tests, too...
2011-06-16replace fchmod()-based heartbeat with raindrops
This means we no longer waste an extra file descriptor per worker process in the master. Now there's no need to set a higher file descriptor limit for systems running >= 1024 workers.
2011-06-16add heartbeat timeout test from Rainbows!
Just in case we break anything
2011-06-15memory reductions in worker process
There's absolutely no need to keep the OptionParser around in worker processes.
2011-06-15test_http_parser: fix for URI too long errors (again)
The random garbage generator may occasionally generate URIs that are too long and cause the URI-specific error to be raised instead of the generic parser error we recently introduced. Follow-up-to: commit 742c4d77f179a757dbcb1fa350f9d75b757acfc7
2011-06-15http_server: kill another stack frame off
We always know we have zero workers at startup, so we don't need to check before hand. SIGHUP users may suffer a small performance decrease as a result, but there's not much we can do about it.
2011-06-15http_server: factor out inherit_listeners! method
This should be easier to understand and reduces garbage on stack, too.
2011-06-15test_response: httpdate is low resolution
It may return the previous second
2011-06-15remove BasicSocket.do_not_reverse_lookup setting
kgio never does reverse lookup
2011-06-15http: delay CoW string invalidations in filter_body
Not all invocations of filter_body will trigger CoW on the given destination string. We can also avoid an unnecessary rb_str_set_len() in the non-chunked path, too.
2011-06-15http: remove tainting flag
Needless line noise, kgio doesn't support tainting anyways.
2011-06-15http_server: get rid of EINTR checks
Ruby IO.select never raises that, actually
2011-06-15test_http_parser: fix for URI too long errors
The random garbage generator may occasionally generate URIs that are too long and cause the URI-specific error to be raised instead of the generic parser error we recently introduced.
2011-06-15http_server: further reduce stack usage for app.call
By avoid Array#each