ChangeLog from git://git.bogomips.org/unicorn.git (0.92.0..0.93.5.9.g171df.dirty) commit 171df888464ec24d94a8e92e38742f86ac55d0f7 Author: Eric Wong Date: Sun Nov 1 11:56:16 2009 -0800 configurator: 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 commit 66a99327d91e3dd1974e615aa985759f984c5c64 Author: Eric Wong Date: Sun Nov 1 19:50:09 2009 +0000 Do 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. commit 9326f16c7d6ae6b60bbc42a171f8c6b70c61bc4f Author: Eric Wong Date: Sat Oct 31 18:55:39 2009 -0700 cleanup error handling and make it less noisy split out uncommon code from the common path commit 2d54043a213671866fb827d937d7814c9171f5e4 Author: Eric Wong Date: Sat Oct 31 23:54:20 2009 +0000 test_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. commit 9f707bc02ffba4e3b792aa7da325f9e550ea27c2 Author: Eric Wong Date: Sat Oct 31 21:14:52 2009 +0000 more 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. commit 2cb4226e52d5010eb4f92942e40499b6aa124262 Author: Eric Wong Date: Sat Oct 31 06:20:41 2009 +0000 tests: 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 commit 0c1f9fe19dacb213c08bce5dad502eeaeb52eb9c Author: Eric Wong Date: Sat Oct 31 06:06:21 2009 +0000 GNUmakefile: fix non-portable tar(1) usage Explicitly specify that we mean to use stdin/stdout since not all tar(1) implementations default to it. commit 96b247571511935be5564f988bb64b180e4cd888 Author: Eric Wong Date: Sat Oct 31 06:06:20 2009 +0000 test_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... commit 49acd52b3f67d5be433babc38a28ea6865af38a5 Author: Eric Wong Date: Thu Oct 29 22:47:37 2009 -0700 cleanup: 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. commit 2f497f7c47730522418e44d9de49ee962e47ff2e Author: Eric Wong Date: Thu Oct 29 14:35:23 2009 -0700 unicorn 0.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) commit 774e523e6d52172ac74483fc526626461708ff02 Author: Eric Wong Date: Thu Oct 29 13:23:27 2009 -0700 TODO: update for next version (possibly 1.0-pre) commit c7750815d56c98911c1dc4db26a8778657b45a1b Author: Eric Wong Date: Thu Oct 29 13:15:01 2009 -0700 fix 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). commit fdffd90d6dc20eafe7518b7dd125f0e09df5e2f9 Author: Eric Wong Date: Thu Oct 29 12:05:30 2009 -0700 TODO: remove --kill I'm still having a hard time justifying this... commit b6bb34bd6ab3a2e2c1b29191e514fb45782a5c8c Author: Eric Wong Date: Tue Oct 27 00:41:22 2009 -0700 unicorn 0.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 commit bbca687b8ce0c0cbf10407f2aaf87e18bfc311e5 Author: Andrey Stikheev Date: Sun Oct 25 13:11:35 2009 +0300 workaround 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+") => # 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 commit 3a624fe924b8f3a9dfdcf5222ed6d1968f462468 Author: Eric Wong Date: Sat Oct 24 09:27:31 2009 -0700 configurator: fix broken example in RDoc Thanks to Greg Melton for reporting. commit fef9051c74645bdd43488d44215fe912d0c033b6 Author: Eric Wong Date: Tue Oct 20 01:11:57 2009 -0700 add news bodies to site NEWS.atom.xml While we're at it, remove trailing whitespace for author names, too. commit e6b2a257cc92d27fe4f404ba5e37ac2887226afc Author: Eric Wong Date: Sun Oct 18 22:48:07 2009 -0700 stop 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). commit 580d242fbfe95ea2ce7709f90f25e655bc2d93ac Author: Eric Wong Date: Fri Oct 16 13:46:18 2009 -0700 KNOWN_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. commit 370cb0670d1b1841ae19e871e7aee4fec167d4e8 Author: Suraj N. Kurapati Date: Tue Oct 13 19:34:21 2009 -0700 show configuration file path in errors instead of '(eval)' also __FILE__ did not reflect configuration file path commit 57a2c5d25fefad3ecbb224e619dda9cca849a298 Author: Eric Wong Date: Tue Oct 13 14:37:56 2009 -0700 configurator: stop testing for non-portable listens IPv4 addresses in the format of: "^[[:digit:]]+:[[:digit:]]+$" isn't very portable.. commit 5aca54809cc1acd61d9078adc34c4e02e60447d4 Author: Eric Wong Date: Mon Oct 12 23:28:23 2009 -0700 README: 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. commit d85480a2986639b408b7c1f99e29b09e70950954 Author: Eric Wong Date: Sat Oct 10 00:21:23 2009 -0700 DESIGN: address concerns about on-demand and thundering herd Based on a private email I just received. commit 79f0b94b946d154fed14b8cbc99430d1a417cb49 Author: Eric Wong Date: Fri Oct 9 15:37:28 2009 -0700 unicorn 0.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 commit 07c81ad6cee7582cb7729ed8244ce2f07118d9bd Author: Eric Wong Date: Fri Oct 9 15:45:24 2009 -0700 drop the whitespace cleaner for Ragel->C Generated C code is no longer checked into git so it doesn't matter. commit de9af3d5a2b378a9563066158eafe05d4c8c8a11 Author: Eric Wong Date: Fri Oct 9 15:24:05 2009 -0700 README: 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. commit b1b38756c6d8f93e2b9e0ffb154dd1c34900b06e Author: Eric Wong Date: Fri Oct 9 15:22:26 2009 -0700 README: remove the "non-existent" part Still pretty rare, though. commit c2ad5e16901ae2d9475e7d2772035ee345316bda Author: Eric Wong Date: Fri Oct 9 15:12:11 2009 -0700 DESIGN: 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. commit 3fd0dfb5e561e966c188c434ea4c5e7907437a19 Author: Eric Wong Date: Fri Oct 9 15:11:50 2009 -0700 README: remove unnecessary and extraneous dash commit 7ab65477c7d8921e93f00b9d7fcf5ad3b5f8a12a Author: Eric Wong Date: Fri Oct 9 15:11:29 2009 -0700 PHILOSOPHY: plug the Rainbows! spin-off project commit ae394f1aac6330e640a4df50eefe54b02b2e8d58 Author: Eric Wong Date: Fri Oct 9 15:08:32 2009 -0700 PHILOSOPHY: 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). commit bbeecaa06049a7e9a063a754c8a58765a692f521 Author: Eric Wong Date: Fri Oct 9 15:06:44 2009 -0700 configurator: 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... commit 9dd3c170e92f1e7559ee329bbde34ea4b17b715c Author: Eric Wong Date: Fri Oct 9 14:26:13 2009 -0700 examples/init.sh: remove "set -u" It's too simple of a script and causes running the init script with zero arguments to fail instead of printing out the usage message. commit 24a1b4c6b5fcb948e4fdee04e286c044d6d45f98 Author: Eric Wong Date: Thu Oct 8 19:56:29 2009 -0700 fchmod heartbeat flips between 0/1 for compatibility This removes the Time.now.to_i comparison that was used to avoid multiple, no-op fchmod() syscalls[1] within the same second. This should allow us to run on OpenBSD where it can raise EINVAL when Time.now.to_i is passed to it. Reported-by: Jeremy Evans [1] - gettimeofday() from Time.now is not a real syscall on VDSO-enabled x86_64 GNU/Linux systems where Unicorn is primarily developed. commit 94b18a11a5445019d4de010271020dfb190e16e7 Author: Eric Wong Date: Wed Oct 7 14:37:12 2009 -0700 doc: expand on the SELF_PIPE description There seems to be a small amount of confusion regarding how it's used (and some of the code is not very obvious). So explain our usage of it and distinguish its use in the master vs worker(s). commit 8bf9006d5d7cf15706a362d301ef4d75254e855c Author: Eric Wong Date: Wed Oct 7 01:37:52 2009 -0700 unicorn 0.93.2 Avoid truncated POST bodies from with URL-encoded forms in Rails by switching TeeInput to use read-in-full semantics (only) when a Content-Length: header exists. Chunked request bodies continue to exhibit readpartial semantics to support simultaneous bidirectional chunking. The lack of return value checking in Rails to protect against a short ios.read(length) is entirely reasonable even if not pedantically correct. Most ios.read(length) implementations return the full amount requested except right before EOF. Also there are some minor documentation improvements. Eric Wong (7): Fix NEWS generation on single-paragraph tag messages Include GPLv2 in docs doc: make it clear contributors retain copyrights TODO: removed Rainbows! (see rainbows.rubyforge.org) Document the START_CTX hash contents more-compatible TeeInput#read for POSTs with Content-Length tests for read-in-full vs readpartial semantics commit e825dd70a7e4a10f0dfba10610fd9d58a7b8e694 Author: Eric Wong Date: Wed Oct 7 00:52:41 2009 -0700 tests for read-in-full vs readpartial semantics We modified TeeInput to have read-in-full semantics in most situations to suit existing apps and libraries (like Rails) that don't check for and handle partial reads correctly. The read-in-full semantics are needed by Rails because of this: https://rails.lighthouseapp.com/projects/8994/tickets/3343 commit 438c99aec2d74489fa89b3a6c60d1fb41bb2f7e6 Author: Eric Wong Date: Tue Oct 6 19:45:05 2009 -0700 more-compatible TeeInput#read for POSTs with Content-Length There are existing applications and libraries that don't check the return value of env['rack.input'].read(length) (like Rails :x). Those applications became broken under the IO#readpartial semantics of TeeInput#read when handling larger request bodies. We'll preserve the IO#readpartial semantics _only_ when handling chunked requests (as long as Rack allows it, it's useful for real-time processing of audio/video streaming uploads, especially with Rainbows! and mobile clients) but use read-in-full semantics for TeeInput#read on requests with a known Content-Length. commit 89c786d64ddbe74905d37bc0d110771de5f79f49 Author: Eric Wong Date: Mon Oct 5 23:31:28 2009 -0700 Document the START_CTX hash contents Modifying this can be useful for esoteric cases like switching entire Ruby installations or if the app was originally started in a no-longer-existent directory and we can't upgrade because we can't chdir to it. commit 2f89282aee40308879bb4565f3370bd5de9c6214 Author: Eric Wong Date: Mon Oct 5 23:04:17 2009 -0700 TODO: removed Rainbows! (see rainbows.rubyforge.org) Rainbows! is more ambitious and a separate project now. commit a7d137f6c869f23be24ee6fab8a3093fc4ae4b7a Author: Eric Wong Date: Mon Oct 5 11:39:12 2009 -0700 doc: make it clear contributors retain copyrights We hope to never require copyright assignment here... commit 7f432152de923eba116a52aeacafa2c54b4e2531 Author: Eric Wong Date: Mon Oct 5 02:14:42 2009 -0700 Include GPLv2 in docs Even though we don't RDoc it, our RDoc still links to it. commit 2643f9c34a4fc63ab9533d851a564be93dcc8bdb Author: Eric Wong Date: Fri Oct 2 18:32:17 2009 -0700 Fix NEWS generation on single-paragraph tag messages commit a2d5ad61d5f7c6b744f49ce549292e7f2d353ead Author: Eric Wong Date: Fri Oct 2 18:17:26 2009 -0700 unicorn 0.93.1 Fix permissions for release tarballs/gems, no other changes. Thanks to Jay Reitz for reporting this. commit fae1978669fe12485edc13ed9a83ebb1479fa3e2 Author: Eric Wong Date: Fri Oct 2 18:17:26 2009 -0700 verify liberal file permissions when packaging Prevent non-umask 0022 shells from generating releases. Thanks for Jay Reitz for spotting this and reporting promptly to me; all of my Ruby and gem installations are done as a regular user so I never would've noticed. commit 76207a66002f088c24423f66f71fa38460e706fc Author: Eric Wong Date: Fri Oct 2 13:50:46 2009 -0700 unicorn 0.93.0 The one minor bugfix is only for Rails 2.3.x+ users who set the RAILS_RELATIVE_URL_ROOT environment variable in a config file. Users of the "--path" switch or those who set the environment variable in the shell were unaffected by this bug. Note that we still don't have relative URL root support for Rails < 2.3, and are unlikely to bother with it unless there is visible demand for it. New features includes support for :tries and :delay when specifying a "listen" in an after_fork hook. This was inspired by Chris Wanstrath's example of binding per-worker listen sockets in a loop while migrating (or upgrading) Unicorn. Setting a negative value for :tries means we'll retry the listen indefinitely until the socket becomes available. So you can do something like this in an after_fork hook: after_fork do |server, worker| addr = "127.0.0.1:#{9293 + worker.nr}" server.listen(addr, :tries => -1, :delay => 5) end There's also the usual round of added documentation, packaging fixes, code cleanups, small fixes and minor performance improvements that are viewable in the "git log" output. Eric Wong (54): build: hardcode the canonical git URL build: manifest dropped manpages build: smaller ChangeLog doc/LATEST: remove trailing newline http: don't force -fPIC if it can't be used .gitignore on *.rbc files Rubinius generates README/gemspec: a better description, hopefully GNUmakefile: add missing .manifest dep on test installs Add HACKING document configurator: fix user switch example in RDoc local.mk.sample: time and perms enforcement unicorn_rails: show "RAILS_ENV" in help message gemspec: compatibility with older Rubygems Split out KNOWN_ISSUES document KNOWN_ISSUES: add notes about the "isolate" gem gemspec: fix test_files regexp match gemspec: remove tests that fork from test_files test_signals: ensure we can parse pids in response GNUmakefile: cleanup test/manifest generation util: remove APPEND_FLAGS constant http_request: simplify and remove handle_body method http_response: simplify and remove const dependencies local.mk.sample: fix .js times TUNING: notes about benchmarking a high :backlog HttpServer#listen accepts :tries and :delay parameters "make install" avoids installing multiple .so objects Use Configurator#expand_addr in HttpServer#listen configurator: move initialization stuff to #initialize Remove "Z" constant for binary strings cgi_wrapper: don't warn about stdoutput usage cgi_wrapper: simplify status handling in response cgi_wrapper: use Array#concat instead of += server: correctly unset reexec_pid on child death configurator: update and modernize examples configurator: add colons in front of listen() options configurator: remove DEFAULT_LOGGER constant gemspec: clarify commented-out licenses section Add makefile targets for non-release installs cleanup: use question mark op for 1-byte comparisons RDoc for Unicorn::HttpServer::Worker small cleanup to pid file handling + documentation rails: RAILS_RELATIVE_URL_ROOT may be set in Unicorn config unicorn_rails: undeprecate --path switch manpages: document environment variables README: remove reference to different versions Avoid a small window when a pid file can be empty configurator: update some migration examples configurator: listen :delay must be Numeric test: don't rely on .manifest for test install SIGNALS: state that we stole semantics from nginx const: DEFAULT_PORT as a string doesn't make sense test_helper: unused_port rejects 8080 unconditionally GNUmakefile: SINCE variable may be unset tests: GIT-VERSION-GEN is a test install dependency commit 0d41fa1cae20138d7215dd2ca18220c686539582 Author: Eric Wong Date: Fri Oct 2 13:49:41 2009 -0700 tests: GIT-VERSION-GEN is a test install dependency commit 5510698bbe765fc4d3fcdbc81a78d702895a05e9 Author: Eric Wong Date: Fri Oct 2 13:40:29 2009 -0700 GNUmakefile: SINCE variable may be unset Makes it easier for new projects with no tags yet to reuse this snippet. commit 65717ecbab432f4acd093d2efefd52bce66409d8 Author: Eric Wong Date: Fri Oct 2 13:35:29 2009 -0700 test_helper: unused_port rejects 8080 unconditionally Checking for addr to match the DEFAULT_HOST constant is wrong since having only 127.0.0.1:8080 will still prevent 0.0.0.0:8080 from being bound. commit cc6ffaf42307ab3bd072c58bd492fb5c5204e687 Author: Eric Wong Date: Fri Oct 2 13:30:58 2009 -0700 const: DEFAULT_PORT as a string doesn't make sense TCP ports are always integers, and it was always allowing a randomly-generated value of 8080 through in the unused_port method of test_helper. commit 66e9f47ee861ed69c57fc110a6d5b3d28f5e373a Author: Eric Wong Date: Fri Oct 2 11:29:44 2009 -0700 SIGNALS: state that we stole semantics from nginx commit eef8d4c4332078ce28959b4afc5870c71a820fdb Author: Eric Wong Date: Fri Oct 2 00:46:01 2009 -0700 test: don't rely on .manifest for test install This lets us run tests out-of-the-box on fresh checkouts and minimizes the overhead needed for creating/updating the test installs. commit d7381d2d96deeb95aac484780b38202b1a7d8115 Author: Eric Wong Date: Fri Oct 2 00:25:01 2009 -0700 configurator: listen :delay must be Numeric :delay may be a Float to represent fractional seconds. commit 62206b128f71f64a684a5e14103178dc6a516125 Author: Eric Wong Date: Fri Oct 2 00:25:00 2009 -0700 configurator: update some migration examples We now give an example of how a before_fork hook can be used to incrementally migrate off the old code base without hitting a thundering herd (especially in the "preload_app false") case. Also comment on the per-worker listen usage in the RDoc, not just a hidden comment. commit eb619c04765ef31b0e88329cbfd138d24558776e Author: Eric Wong Date: Thu Oct 1 13:21:57 2009 -0700 Avoid a small window when a pid file can be empty There's always been a small window of opportunity for a script to do File.read(pid).to_i would cause File.read() to read an empty file and return "". This closes that window while hopefully retaining backwards compatibility... We've always checked for dirname(pid) writability in Configurator, so we can safely write to a temporary file in the intended directory and then atomically rename() it to the destination path. commit 9dcbd1387c4c23c84f5a733b6e2e2839b239bdac Author: Eric Wong Date: Wed Sep 30 23:54:38 2009 -0700 README: remove reference to different versions The >= 0.90.x series has been working out pretty well so far with only a few minor bug fixes in between, so it'll be less confusing. commit a0384e6adeb4e9d072cc2fa39a47212ee784ecf8 Author: Eric Wong Date: Wed Sep 30 23:51:13 2009 -0700 manpages: document environment variables Mostly for `unicorn_rails`, but TMPDIR is universal. commit 6befcbc2457f6d6eebd836adc08ee34e696588bd Author: Eric Wong Date: Wed Sep 30 23:49:53 2009 -0700 unicorn_rails: undeprecate --path switch ..but keep -P deprecated. --path is still useful for testing ad-hoc changes when you don't want to commit your changes permanently to a configuration file. commit e87d9decb82fbbde50926911167fecebd4bcc25e Author: Eric Wong Date: Wed Sep 30 15:02:59 2009 -0700 rails: RAILS_RELATIVE_URL_ROOT may be set in Unicorn config Since Unicorn config files are written in Ruby, setting RAILS_RELATIVE_URL_ROOT should be possible (and even encouraged) in the config file if it is done at all. commit e417bd2d262f703212d4d671498420e554105639 Author: Eric Wong Date: Wed Sep 30 13:41:29 2009 -0700 small cleanup to pid file handling + documentation It's pointless to try and stat a file before trying to read it. Instead just try opening it and rescue ENOENT because it would've been racy anyways. Additionally add some comments to keep us from forgetting why we did the things we did with the pid file management. commit f3f43f1b6c3930525a892c8ce860f072184fe981 Author: Eric Wong Date: Wed Sep 30 13:41:28 2009 -0700 RDoc for Unicorn::HttpServer::Worker I'd rather document and maintain a stable interface for the Worker class than to have to deal with potential (portability and security) issues with with supporting user privilege management right now. There's already an example of user/group-switching support in the after_fork() hook and the error handling involved may be different depending on the application and environment so I remain hesitant to add official support for it... commit 407724b49069ee539e9a918ce75e9d1290552471 Author: Eric Wong Date: Wed Sep 30 13:41:27 2009 -0700 cleanup: use question mark op for 1-byte comparisons It's compatible with both Ruby 1.8 and 1.9 without needing a Range object. commit 9cc4f87353b84f5229d4a8bae78260c24cd02154 Author: Eric Wong Date: Wed Sep 30 13:41:26 2009 -0700 Add makefile targets for non-release installs This should make it easier to test and run unreleased versions. commit 31533ab442959f975306c4275daa6c6770d29246 Author: Eric Wong Date: Mon Sep 28 01:21:36 2009 -0700 gemspec: clarify commented-out licenses section It may have caused confusion that the licenses we're under were incompatible with older Rubygems which is not the case. commit aafc9bf7f051c6f2fb0047647d4ed26b3a825ea3 Author: Eric Wong Date: Mon Sep 28 00:15:35 2009 -0700 configurator: remove DEFAULT_LOGGER constant We no longer have external lookups for it so just stick it in the DEFAULTS hash for now. Since the Configurator::DEFAULTS hash can be considered a stable interface for other modules to interact with, they can eventually just use it instead of relying on another constant. commit 69b6f9aaec80f3da2f9d249545c06ccb6ec316cb Author: Eric Wong Date: Mon Sep 28 00:13:12 2009 -0700 configurator: add colons in front of listen() options Hopefuly make it more obvious that they're Ruby symbols and not strings. While we're at it, fix ordering of :{rcv,snd}buf descriptions to (logically) match the order of mention. commit 3c1449df986387f6d812a97adf5f8fa47c28c891 Author: Eric Wong Date: Mon Sep 28 00:03:46 2009 -0700 configurator: update and modernize examples * Use the new :tries and :default parameters for listen() instead of the ugly and less-effective "rescue nil" * ActiveRecord connection management examples for hooks when using for "preload_app true" * combine "preload_app true" example with REE COW-friendly optimization for memory savings Some of these are based on Chris Wanstrath's configuration posted here: http://gist.github.com/189623 commit 762db4854c06196b8941fe9fb303280429fe4cdc Author: Eric Wong Date: Sun Sep 27 23:47:57 2009 -0700 server: correctly unset reexec_pid on child death Sometimes the upgraded version won't survive and we can fail to unset that pid and instead accidentally create a local variable. This is unlikely to be a problem in practice because this variable is immediately reclobbered when we fork. commit 2f1155794a6a1709f9e48b8115d6bd3531b2d814 Author: Eric Wong Date: Sun Sep 27 23:23:20 2009 -0700 cgi_wrapper: use Array#concat instead of += Array#concat avoids an intermediate Array object from being allocated (yes, still supporting Rails <= 1.2.x apps...) commit 9d27c9a2ee7902788e0f8abc433c7da6302e4c24 Author: Eric Wong Date: Sun Sep 27 23:16:15 2009 -0700 cgi_wrapper: simplify status handling in response Our HttpResponse class interprets non-Integer string status now as well as falling back if it can't be looked up. commit 6d7230207e43bf8a6f6bdbe505fb05fbd70389ac Author: Eric Wong Date: Sun Sep 27 23:11:32 2009 -0700 cgi_wrapper: don't warn about stdoutput usage It really shouldn't be a problem for existing CGI apps to write to the StringIO object.. commit 79c270990ec3a657c23510ee4f2f7f2b4c2c748f Author: Eric Wong Date: Sun Sep 27 20:48:20 2009 -0700 Remove "Z" constant for binary strings We've started using magic comments to ensure any strings we create are binary instead. Additionally, ensure we create any StringIO objects with an explicit string (which default to binary) to ensure the StringIO object is binary. This is because StringIO.new (with no arguments) will always use the process-wide default encoding since it does not know about magic comments (and couldn't, really...) commit 3b0fcbf8baafbb88b2f15631b949fde9c8acff3b Author: Eric Wong Date: Sun Sep 27 19:33:21 2009 -0700 configurator: move initialization stuff to #initialize Avoids making the #listen method any noisier than it should be. commit 23fcda1c47db663ab8b809dc1dcae2726709dcc5 Author: Eric Wong Date: Sun Sep 27 19:18:19 2009 -0700 Use Configurator#expand_addr in HttpServer#listen This may be redundant for the "normal" configuration file directive, but allows the same syntax to be used in after_fork hooks where HttpServer#listen() may be called. commit 134a0b59c87a0f42653ca4bce8900a3cb1144ca9 Author: Eric Wong Date: Sun Sep 27 19:02:44 2009 -0700 "make install" avoids installing multiple .so objects Sometimes we test with unicorn_http.so in lib, but that gets mistakenly picked up by setup.rb and can wreak havoc for on upgrades if ABIs change. commit aa83722ab57fe05ac88164cfac949bb13c4aa7a5 Author: Eric Wong Date: Sun Sep 27 18:09:28 2009 -0700 HttpServer#listen accepts :tries and :delay parameters This allows per-worker listeners to be configured to retry and and not continue until the equivalent worker belonging to a previous master (or even another server) has released the socket. In the Configurator RDoc, include better examples for per-worker server.listen calls using these :tries == -1. Inspired by an example by Chris Wanstrath. commit 7774d770f0021e25a644e85ad404e8acb7b81afc Author: Eric Wong Date: Sun Sep 27 18:01:53 2009 -0700 TUNING: notes about benchmarking a high :backlog Based on the experiences of Tom Preston-Werner: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/24/focus=28 commit 3c873b25891b6aa3c46b29026dc8c4011dd18bc7 Author: Eric Wong Date: Sun Sep 27 17:31:04 2009 -0700 local.mk.sample: fix .js times Also make files easier to overwrite while we're at it commit 32d5db4f499dbbe3e9026969eee66592800dd725 Author: Eric Wong Date: Sun Sep 27 17:27:01 2009 -0700 http_response: simplify and remove const dependencies We don't need the Z constant anymore and inlining the header writing gives a small overall performance improvement in microbenchmarks. This also makes this method reentrant and thread-safe for Rainbows as well. commit 8e1f0620e567cd676902e4ed34edb042f28ec3b0 Author: Eric Wong Date: Sun Sep 27 17:26:59 2009 -0700 http_request: simplify and remove handle_body method It is simpler and even slightly faster in micro benchmarks when inlined. commit 0d43e19396a325ac9fe8b6c0a6031c87c0202697 Author: Eric Wong Date: Sun Sep 27 17:26:57 2009 -0700 util: remove APPEND_FLAGS constant One less thing to RDoc commit dd400a46dc101bb679e173e37e79fa31d96b8acf Author: Eric Wong Date: Sun Sep 27 17:26:56 2009 -0700 GNUmakefile: cleanup test/manifest generation The .manifest dependencies were causing unnecessarily copies for the tests to run. commit 0c3ec1aca5ad3b6f687ecdc75f193e2a0f0ae4a1 Author: Eric Wong Date: Sun Sep 27 17:26:54 2009 -0700 test_signals: ensure we can parse pids in response We don't want to accidentally kill every process in the process group. commit 9c00824720ec9be3b13ac8d66175e063c28885f0 Author: Eric Wong Date: Sun Sep 27 17:26:51 2009 -0700 gemspec: remove tests that fork from test_files This allows `gem check -t unicorn` to work. The rest of the tests run with GNU make but I don't have the patience to get them working with pure-Ruby since I can't stand running those tests sequentially anyways. commit 68df54e341a118b6658cfe0dcd2ff9b006883d20 Author: Eric Wong Date: Sun Sep 27 17:26:48 2009 -0700 gemspec: fix test_files regexp match Not sure if anybody runs tests with Rubygems directly (instead of unpacking the source tree, but it's there) commit 899bee1fe5eb01efbadc44a00eed71358e77141b Author: Eric Wong Date: Thu Sep 24 18:33:26 2009 -0700 KNOWN_ISSUES: add notes about the "isolate" gem This issue is still being looked at, but hopefully this note can help folks if they run into this. commit 554a4f63b8e0571bbd15d2b99637952da4b8f881 Author: Eric Wong Date: Thu Sep 24 17:20:37 2009 -0700 Split out KNOWN_ISSUES document This deserves to be a separate document and easier to find/edit. commit 39dbbc97fbbf04c6b7ba956e71648222589beb44 Author: Eric Wong Date: Thu Sep 24 13:37:56 2009 -0700 gemspec: compatibility with older Rubygems "licenses=" is not in older Rubygems and some organizations are still stuck on those... commit 5a87a2630ec15ab8e730a2bf3bf03c6fd84ff4a2 Author: Eric Wong Date: Thu Sep 24 13:33:19 2009 -0700 unicorn_rails: show "RAILS_ENV" in help message This matches the manpage and the rest of the documentation. commit dbf7eb6748d5b7ea8d2f309748756ffc336ba484 Author: Eric Wong Date: Tue Sep 22 11:40:01 2009 -0700 local.mk.sample: time and perms enforcement commit 3ac1670c870cf26a6e578c880151c49b7b289a82 Author: Eric Wong Date: Tue Sep 22 11:30:06 2009 -0700 configurator: fix user switch example in RDoc We changed this in 97e469fc3afb751618b8b9a7b364cb447aaf90dd but never updated the example. commit 2730d875650ee8c3121d457743419dce7ce69aef Author: Eric Wong Date: Sat Sep 19 19:01:03 2009 -0700 Add HACKING document commit 179dec40d0760c2456d1f3e7b94dda5073d5b0a4 Author: Eric Wong Date: Fri Sep 18 17:32:45 2009 -0700 GNUmakefile: add missing .manifest dep on test installs Now tests run after a clean checkout (as long as rack libraries are in $LOAD_PATH, probably via RUBYLIB). commit ce2602376cf586e68d11174004539609de6fa6b0 Author: Eric Wong Date: Fri Sep 18 16:59:44 2009 -0700 README/gemspec: a better description, hopefully commit 14709a4e306aec175cadd88ddcabe599f4636ed5 Author: Eric Wong Date: Fri Sep 18 16:41:04 2009 -0700 .gitignore on *.rbc files Rubinius generates commit 4f58f4a4d60806af7233193852be134cb74c7c21 Author: Eric Wong Date: Fri Sep 18 16:39:15 2009 -0700 http: don't force -fPIC if it can't be used Not everybody can use it, even if most of the world can. commit 413322fa1851917b749383e9207d16ba58274f59 Author: Eric Wong Date: Fri Sep 18 16:00:11 2009 -0700 doc/LATEST: remove trailing newline Make finger output as meaningful as possible to folks on slower connections and small terminals commit b3fb60334bbb62bbcc62348128bd4b3897bd2ad5 Author: Eric Wong Date: Fri Sep 18 15:25:12 2009 -0700 build: smaller ChangeLog No need to bloat our tarballs too much with information people are unlikely to ever read, NEWS is more user-oriented. commit 3bdcb9c6b1852448d3b47fbb46cf6c65b3227477 Author: Eric Wong Date: Fri Sep 18 14:57:18 2009 -0700 build: manifest dropped manpages $(wildcard) is evaluated as soon as the target command is called, resulting in the manpages not being globbed since we just generated them. Also, bundle manpages with documentation. commit f1e3d4a3828c377ef19f1f3d754457221c200bc4 Author: Eric Wong Date: Fri Sep 18 14:51:22 2009 -0700 build: hardcode the canonical git URL I just distributed a tarball with my local FS path in the documentation :(