about summary refs log tree commit homepage
DateCommit message (Collapse)
2009-11-05unicorn 0.94.0 v0.94.0
The HTTP parser is fix for oddly-aligned reads of trailers (this technically affects headers, too, but is highly unlikely due to our non-support of slow clients). This allows our HTTP parser to better support very slow clients when used by other servers (like Rainbows!). Fortunately this bug does not appear to lead to any invalid memory accesses (and potential arbitrary code execution). FreeBSD (and possibly other *BSDs) support is improved and and all the test cases pass under FreeBSD 7.2. Various flavors of GNU/Linux remains our primary platform for development and production. New features added include the "working_directory" directive in the configurator . Even without specifying a "working_directory", symlink-aware detection of the current path no longer depends on /bin/sh so it should work out-of-the-box on FreeBSD and Solaris and not just systems where /bin/sh is dash, ksh93 or bash. User-switching support is finally supported but only intended for use in the after_fork hook of worker processes. Putting it in the after_fork hook allows allows users to set things like CPU affinity[1] on a per-worker basis before dropping privileges. The master process retains all privileges it started with. The ENV["RACK_ENV"] (process-wide) environment variable is now both read and set for `unicorn' in the same way RAILS_ENV is used by `unicorn_rails'. This allows the Merb launcher to read ENV["RACK_ENV"] in config.ru. Other web servers already set this and there may be applications or libraries that already rely on this de facto standard. Eric Wong (26): cleanup: avoid redundant error checks for fstat test_helper: connect(2) may fail with EINVAL GNUmakefile: fix non-portable tar(1) usage tests: provide a pure Ruby setsid(8) equivalent more portable symlink awareness for START_CTX[:cwd] test_signals: avoid portability issues with fchmod(2) cleanup error handling and make it less noisy Do not override Dir.chdir in config files configurator: add "working_directory" directive configurator: working_directory is expanded configurator: set ENV["PWD"] with working_directory, too configurator: working_directory affects pid, std{err,out}_paths configurator: update documentation for working_directory TODO: remove working_directory bit, done Util.reopen_logs: remove needless Range worker: user/group switching for after_fork hooks Fix autoload of Etc in Worker for Ruby 1.9 bin/unicorn: allow RACK_ENV to be passed from parent tests for RACK_ENV preservation http: allow headers/trailers to be written byte-wise http: extra test for bytewise chunked bodies tee_input: do not clobber trailer buffer on partial uploads test_exec: ensure master is killed after test Util::tmpio returns a TmpIO that responds to #size TODO: remove user-switching bit, done unicorn 0.94.0 Wayne Larsen (1): bin/unicorn: set ENV["RACK_ENV"] on startup [1] - Unicorn does not support CPU affinity directly, but it is possible to load code that allows it inside after_fork hooks, or even just call sched_tool(8).
2009-11-05TODO: remove user-switching bit, done
2009-11-05Util::tmpio returns a TmpIO that responds to #size
Subclass off the core File class so we don't have to worry about #size being defined. This will mainly be useful to Rainbows! but allows us to simplify our TeeInput implementation a little, too.
2009-11-04test_exec: ensure master is killed after test
The relative working_directory test runs so quickly that the master may not even have signal handlers setup by the time we're done with it. The proper way would be to not start workers until the master is ready, but that breaks some test cases horribly.
2009-11-04tee_input: do not clobber trailer buffer on partial uploads
Found in Rainbows! testing. Reusing the buffer when finalizing input for headers could be problematic because it would lead to the @buf2 instance variable being clobbered; allowing the trailers to "leak" into the body.
2009-11-04http: extra test for bytewise chunked bodies
Make sure we're completely resumable no matter how idiotic clients are.
2009-11-04http: allow headers/trailers to be written byte-wise
This allows clients to trickle headers and trailers. While Unicorn itself does not support slow clients for many reasons, this affects servers that depend on our parser like Rainbows!. This actually does affect Unicorn when handling trailers, but HTTP trailers are very ever rarely used in requests. Fortunately this stupid bug does not seem able to trigger out-of-bounds conditions.
2009-11-04tests for RACK_ENV preservation
Prevent ourselves from breaking things in case applications start depending on this.
2009-11-04bin/unicorn: allow RACK_ENV to be passed from parent
This makes our RACK_ENV handling like our RAILS_ENV handling for unicorn_rails, removing the redundant local variable.
2009-11-04Fix autoload of Etc in Worker for Ruby 1.9
Constant scoping appears to be a bit different under 1.9
2009-11-04worker: user/group switching for after_fork hooks
This must be called in the after_fork hook because there may be Ruby modules that'll allow things such as CPU affinity and scheduling class/priority to be set on a per-worker basis. So we give the user the ability to change users at any time during the after_fork hook.
2009-11-03Util.reopen_logs: remove needless Range
?/ avoids allocating a String in 1.8 and in 1.9 short String objects are cheap.
2009-11-03TODO: remove working_directory bit, done
2009-11-03configurator: update documentation for working_directory
We follow the principle of least surprise now, so less documentation is better documentation.
2009-11-03configurator: working_directory affects pid, std{err,out}_paths
It makes more sense this way since users usually expect config file directives to be order-independent.
2009-11-03configurator: set ENV["PWD"] with working_directory, too
Just in case anything depends on it, we'll have it set correctly because it's usually set by the $SHELL
2009-11-03configurator: working_directory is expanded
Allow people to use "~" and relative paths, like all of our other paths.
2009-11-03bin/unicorn: set ENV["RACK_ENV"] on startup
Although not currently part of the Rack specification, ENV["RACK_ENV"] is at least a de facto standard. Some of the popular Rack servers (Thin, Passenger) and frameworks (Merb, Sinatra) already set or use it. ML-Ref: <C7A9411D-CD40-4DA4-9CB3-6AA959D2D127@larsen.st> Acked-by: Eric Wong <normalperson@yhbt.net> [ew: setenv always, not just on CLI + commit message]
2009-11-01configurator: add "working_directory" directive
This basically a prettier way of saying: Dir.chdir(Unicorn::HttpServer::START_CTX[:cwd] = path) In the config file. Unfortunately, this is configuration directive where order matters and you should specify it before any other path[1] directives if you're using relative paths (relative paths are not recommended anyways) [1] pid, stderr_path, stdout_path
2009-11-01Do not override Dir.chdir in config files
Even if START_CTX[:cwd] is pointing to another directory, avoid overriding the user's decision to Dir.chdir if they do it in either the Unicorn config file or the config.ru.
2009-10-31cleanup error handling and make it less noisy
split out uncommon code from the common path
2009-10-31test_signals: avoid portability issues with fchmod(2)
Just write bytes to the file instead and track its size increase instead of its mode. As of now all the unit tests pass under FreeBSD 7.2.
2009-10-31more portable symlink awareness for START_CTX[:cwd]
`sh -c pwd` doesn't reliably read ENV["PWD"] on all platforms, this means that directories that are symlinks may be ignored and the real path is resolved. This can be problematic when doing upgrades for common deployment systems such as Capistrano which rely on the working directory being a symlink.
2009-10-30tests: provide a pure Ruby setsid(8) equivalent
setsid(8) is non-portable, but we depend on Ruby already and it's trivial to implement; so just use the Ruby-only version
2009-10-30GNUmakefile: fix non-portable tar(1) usage
Explicitly specify that we mean to use stdin/stdout since not all tar(1) implementations default to it.
2009-10-30test_helper: connect(2) may fail with EINVAL
Not documented on FreeBSD 7.2, but it seems to happen there and searching around, it seems to happen on other systems, too...
2009-10-29cleanup: avoid redundant error checks for fstat
If fstat() fails on an open file descriptor in the master, something is seriously wrong (like your kernel is broken/buggy) and trying to restart the worker that owned that file descriptor is likely masking the symptoms. Instead let the error propagate up to the main loop to avoid wasting cycles to restart broken workers.
2009-10-29unicorn 0.93.5 v0.93.5
This release fixes a regression introduced in 0.93.3 where timed-out worker processes run a chance of not being killed off at all if they're hung. While it's not ever advisable to have requests take a long time, we realize it's easy to fix everything :) Eric Wong (3): TODO: remove --kill fix reliability of timeout kills TODO: update for next version (possibly 1.0-pre)
2009-10-29TODO: update for next version (possibly 1.0-pre)
2009-10-29fix reliability of timeout kills
The method introduced in commit 6c8a3d3c55997978bacaecc5dbbb7d03c2fee345 to avoid killing workers after suspend/hibernate interacted badly with the change for OpenBSD fchmod(2) compatibility introduced with the 0.93.3 release. This interaction lead to workers with files stuck in the zero state to never be murdered off for timeout violations. Additionally, the method to avoid killing processes off was never completely reliable and has been reworked even if we entered suspend/hibernate/STOP during client processing. This regression was discovered during continued development of the Rainbows! test suite (which we will bring over as it becomes ready).
2009-10-29TODO: remove --kill
I'm still having a hard time justifying this...
2009-10-27unicorn 0.93.4 v0.93.4
This release mainly works around BSD stdio compatibility issues that affect at least FreeBSD and OS X. While this issues was documented and fixed in [ruby-core:26300][1], no production release of MRI 1.8 has it, and users typically upgrade MRI more slowly than gems. This issue does NOT affect 1.9 users. Thanks to Vadim Spivak for reporting and testing this issue and Andrey Stikheev for the fix. Additionally there are small documentation bits, one error handling improvement, and one minor change that should improve reliability of signal delivery. Andrey Stikheev (1): workaround FreeBSD/OSX IO bug for large uploads Eric Wong (7): DESIGN: address concerns about on-demand and thundering herd README: alter reply conventions for the mailing list configurator: stop testing for non-portable listens KNOWN_ISSUES: document Rack gem issue w/Rails 2.3.2 stop continually resends signals during shutdowns add news bodies to site NEWS.atom.xml configurator: fix broken example in RDoc Suraj N. Kurapati (1): show configuration file path in errors instead of '(eval)' [1] http://redmine.ruby-lang.org/issues/show/2267
2009-10-25workaround FreeBSD/OSX IO bug for large uploads
Under FreeBSD writing to the file in sync mode does not change current position, so change position to the end of the file. Without this patch multipart post requests with large data (image uploading) does not work correctly: Status: 500 Internal Server Error bad content body /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:347:in `parse_multipart' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `loop' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `parse_multipart' File position behavior under FreeBSD : ruby -v ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd7] irb(main):001:0> b = File.new("abc", "w+") => #<File:abc> irb(main):002:0> b.sync = true => true irb(main):004:0> b.write("abc") => 3 irb(main):005:0> b.pos => 0 Acked-by: Eric Wong <normalperson@yhbt.net>
2009-10-24configurator: fix broken example in RDoc
Thanks to Greg Melton for reporting.
2009-10-20add news bodies to site NEWS.atom.xml
While we're at it, remove trailing whitespace for author names, too.
2009-10-18stop continually resends signals during shutdowns
Since our :QUIT and :TERM signal handlers are idempotent, we can safely retry sending signals in case workers don't/can't handle them them the first time around. This appears to be a problem with the Thread-based concurrency models in Rainbows! not behaving well (no surprise, though, since pthreads and signals are difficult to manage/mix properly).
2009-10-16KNOWN_ISSUES: document Rack gem issue w/Rails 2.3.2
In short: upgrade to Rails 2.3.4 (or later) ref: http://mid.gmane.org/20091014221552.GA30624@dcvr.yhbt.net Note: the workaround described in the article above only made the issue more subtle and we didn't notice them immediately.
2009-10-13show configuration file path in errors instead of '(eval)'
also __FILE__ did not reflect configuration file path
2009-10-13configurator: stop testing for non-portable listens
IPv4 addresses in the format of: "^[[:digit:]]+:[[:digit:]]+$" isn't very portable..
2009-10-12README: alter reply conventions for the mailing list
Mailman is now configured to munge Reply-To: to point back to the mailing list. This might make things easier for folks on low traffic mailing lists like ours.
2009-10-10DESIGN: address concerns about on-demand and thundering herd
Based on a private email I just received.
2009-10-09unicorn 0.93.3 v0.93.3
This release fixes compatibility with OpenBSD (and possibly other Unices with stricter fchmod(2) implementations) thanks to Jeremy Evans. Additionally there are small documentation changes all around. Eric Wong (11): doc: expand on the SELF_PIPE description fchmod heartbeat flips between 0/1 for compatibility examples/init.sh: remove "set -u" configurator: update with nginx fail_timeout=0 example PHILOSOPHY: clarify experience other deployments PHILOSOPHY: plug the Rainbows! spin-off project README: remove unnecessary and extraneous dash DESIGN: clarification and possibly improve HTML validity README: remove the "non-existent" part README: emphasize the "fast clients"-only part drop the whitespace cleaner for Ragel->C
2009-10-09drop the whitespace cleaner for Ragel->C
Generated C code is no longer checked into git so it doesn't matter.
2009-10-09README: emphasize the "fast clients"-only part
While Unicorn is one of very many Unix-only, pre-forking, shared socket servers in existence, and Unicorn is _definitely_ not the only server that only works *well* with fast clients, either. But as far as we know, Unicorn is the first (and so far only) server that emphasizes only working well with fast clients.
2009-10-09README: remove the "non-existent" part
Still pretty rare, though.
2009-10-09DESIGN: clarification and possibly improve HTML validity
It's "Ragel+C" (as well as being Ragel->C) because there is C code in the parser. Oddly, validator.w3.org doesn't complain about the unescaped ">", but we'll err on the safe side for blissful ignorance.
2009-10-09README: remove unnecessary and extraneous dash
2009-10-09PHILOSOPHY: plug the Rainbows! spin-off project
2009-10-09PHILOSOPHY: clarify experience other deployments
I've only served in an advisory role in most of those instances and I relied on feedback from other folks (especially for Tomcat since I know almost nothing about that).
2009-10-09configurator: update with nginx fail_timeout=0 example
It has come to our attention that this setting is not very well-known to the rest of the world...