Files | Admin

Notes:

Release Name: 0.95.0

Notes:
Unicorn is a HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels.  Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between Unicorn and slow clients.

* http://unicorn.bogomips.org/
* mongrel-unicorn@rubyforge.org
* git://git.bogomips.org/unicorn.git

Changes:

Mostly internal cleanups and documentation updates.  Irrelevant
stacktraces from client disconnects/errors while reading
"rack.input" are now cleared to avoid unnecessary noise.  If
user switching in workers is used, ownership of logs is now
preserved when reopening worker logs (send USR1 only to the the
master in this case).  The timeout config no longer affects long
after_fork hooks or application startups.

New features include the addition of the :umask option for the
"listen" config directive and error reporting for non-portable
socket options.

No ponies have ever been harmed in our development.

Eric Wong (28):
      unicorn.1: document RACK_ENV changes in 0.94.0
      HACKING: update with "gmake" in examples
      don't nuke children for long after_fork and app loads
      local.mk.sample: steal some updates from Rainbows!
      Load Unicorn constants when building app
      tee_input: fix RDoc argument definition for tee
      Add FAQ
      FAQ: fix links to Configurator docs
      tee_input: better premature disconnect handling
      tee_input: don't shadow struct members
      raise Unicorn::ClientShutdown if client aborts in TeeInput
      tee_input: fix comment from an intermediate commit
      FAQ: additional notes on getting HTTPS redirects right
      configurator: update RDoc and comments in examples
      bump version to 0.95.0pre
      configurator: listen :umask parameter for UNIX sockets
      preserve user/group ownership when reopening logs
      old_rails/static: avoid freezing strings
      old_rails: autoload Static
      const: no need to freeze HTTP_EXPECT
      test_server: ensure stderr is written to before reading
      tee_input: expand client error handling
      replace "rescue => e" with "rescue Object => e"
      socket_helper: do not hide errors when setting socket options
      socket_helper: RDoc for constants
      ClientShutdown: RDoc
      Rakefile: add raa_update task
      tee_input: client_error always raises



Changes: .document | 1 + Documentation/unicorn.1.txt | 5 ++ FAQ | 45 +++++++++++++++++ GIT-VERSION-GEN | 2 +- GNUmakefile | 2 +- HACKING | 13 +++-- Rakefile | 41 +++++++++++++++- SIGNALS | 7 +++ bin/unicorn_rails | 1 - lib/unicorn.rb | 26 ++++++++-- lib/unicorn/app/old_rails.rb | 4 +- lib/unicorn/app/old_rails/static.rb | 8 ++- lib/unicorn/configurator.rb | 34 ++++++++++--- lib/unicorn/const.rb | 4 +- lib/unicorn/socket_helper.rb | 26 +++++++--- lib/unicorn/tee_input.rb | 48 ++++++++++++------ lib/unicorn/util.rb | 31 +++++++++--- local.mk.sample | 29 +++++++---- test/unit/test_server.rb | 92 ++++++++++++++++++++++++++++++++++- test/unit/test_socket_helper.rb | 14 +++++ unicorn.gemspec | 2 +- 21 files changed, 365 insertions(+), 70 deletions(-) commit 6311cc30b96b08f72fe00a9a0d1e291cf9923e52 Author: Eric Wong Date: Sun Nov 15 14:02:03 2009 -0800 unicorn 0.95.0 Mostly internal cleanups and documentation updates. Irrelevant stacktraces from client disconnects/errors while reading "rack.input" are now cleared to avoid unnecessary noise. If user switching in workers is used, ownership of logs is now preserved when reopening worker logs (send USR1 only to the the master in this case). The timeout config no longer affects long after_fork hooks or application startups. New features include the addition of the :umask option for the "listen" config directive and error reporting for non-portable socket options. No ponies have ever been harmed in our development. Eric Wong (28): unicorn.1: document RACK_ENV changes in 0.94.0 HACKING: update with "gmake" in examples don't nuke children for long after_fork and app loads local.mk.sample: steal some updates from Rainbows! Load Unicorn constants when building app tee_input: fix RDoc argument definition for tee Add FAQ FAQ: fix links to Configurator docs tee_input: better premature disconnect handling tee_input: don't shadow struct members raise Unicorn::ClientShutdown if client aborts in TeeInput tee_input: fix comment from an intermediate commit FAQ: additional notes on getting HTTPS redirects right configurator: update RDoc and comments in examples bump version to 0.95.0pre configurator: listen :umask parameter for UNIX sockets preserve user/group ownership when reopening logs old_rails/static: avoid freezing strings old_rails: autoload Static const: no need to freeze HTTP_EXPECT test_server: ensure stderr is written to before reading tee_input: expand client error handling replace "rescue => e" with "rescue Object => e" socket_helper: do not hide errors when setting socket options socket_helper: RDoc for constants ClientShutdown: RDoc Rakefile: add raa_update task tee_input: client_error always raises commit e782ce4c82a6e6eb6c5fe9f66471a0fa33e1f9e8 Author: Eric Wong Date: Sun Nov 15 14:11:39 2009 -0800 tee_input: client_error always raises We do not hide unforseen exceptions, as that could cause us to waste precious time attempting to continue processing after errors. commit a1321e72bea710270d1091a5616f0bbd1e2bbad4 Author: Eric Wong Date: Sun Nov 15 14:00:47 2009 -0800 Rakefile: add raa_update task commit 54ab41af8430e00acba87ae6eac455574cdb3838 Author: Eric Wong Date: Sun Nov 15 12:38:49 2009 -0800 ClientShutdown: RDoc commit e2f68e87cdccc872a680a5ce7e4368361ee3bfec Author: Eric Wong Date: Sun Nov 15 12:34:18 2009 -0800 socket_helper: RDoc for constants commit 177db62ef7566e129a52a3ee1afcd4bfb6073452 Author: Eric Wong Date: Sun Nov 15 12:17:39 2009 -0800 socket_helper: do not hide errors when setting socket options Since they're all optional, make them non-fatal, but make sure we log them so we can diagnose what (if anything) is going wrong. commit 1356d7c2c178adf68fbb8b745524b8f20c0b292e Author: Eric Wong Date: Sun Nov 15 12:10:42 2009 -0800 replace "rescue => e" with "rescue Object => e" "Object" is needless noise and some folks are annoyed by seeing it. commit a80ba923659a4287f05a8c69fe2c5ad8b65d28f7 Author: Eric Wong Date: Sun Nov 15 12:09:23 2009 -0800 tee_input: expand client error handling First move it to a separate method, this allows subclasses to reuse our error handler. Additionally, capture HttpParserError as well since backtraces are worthless when a client sends us a bad request, too. commit 6d7e11482a484b50215701993408057b80c82bbe Author: Eric Wong Date: Sun Nov 15 12:09:14 2009 -0800 test_server: ensure stderr is written to before reading This works around a race condition caused by the server closing the connection before writing out to stderr in the ensure block. So to ensure we've waited on the server to write to the log file, just send another HTTP request since we know our test server only processes requests serially. commit ada989844090d88c4fdc0a568ff4df2c0c8397fb Author: Eric Wong Date: Sat Nov 14 17:53:11 2009 -0800 const: no need to freeze HTTP_EXPECT We never set this as a hash key, so there's no performance gain from having a frozen string. commit 83dc65dcc16047edcbc65d077097da83b5caf2d6 Author: Eric Wong Date: Sat Nov 14 17:51:48 2009 -0800 old_rails: autoload Static It makes life easier for people writing config.ru files for use with Rails. commit 8057c9584af44da07fdd7a8b37ac08cc79d9773c Author: Eric Wong Date: Sat Nov 14 17:44:02 2009 -0800 old_rails/static: avoid freezing strings No need to freeze them unless we're assigning new hash values (PATH_INFO is already hashed when we assign it). commit 5663773f053a0cd9764e43b9f34b341f6df5853f Author: Eric Wong Date: Sat Nov 14 15:53:17 2009 -0800 preserve user/group ownership when reopening logs This is only supported when SIGUSR1 is sent only to the master process (which then resends SIGUSR1 to the workers). Since we only added support for user/group switching in the workers, we now chown any log files upon switching users so the master can pick up and chown the log files later on. Thus we can avoid having to restart workers because they fail to rotate log files on their own. commit 07767ea2733ed5276ec638fa50102dccb0b2991e Author: Eric Wong Date: Sat Nov 14 15:28:37 2009 -0800 configurator: listen :umask parameter for UNIX sockets Typically UNIX domain sockets are created with more liberal file permissions than the rest of the application. By default, we create UNIX domain sockets to be readable and writable by all local users to give them the same accessibility as locally-bound TCP listeners. This only has an effect on UNIX domain sockets. This was inspired by Suraj Kurapati in cfbcd2f00911121536rd0582b8u961f7f2a8c6e546a@mail.gmail.com commit b88fe4513e310f5f38076cb137f6327d684a1d55 Author: Eric Wong Date: Fri Nov 13 18:47:20 2009 -0800 bump version to 0.95.0pre We need a minor version since we will expose Unicorn::ClientDisconnect. commit ea58c416ac352063ede2d932c422745fe090bb5e Author: Eric Wong Date: Fri Nov 13 18:39:29 2009 -0800 configurator: update RDoc and comments in examples Some of this based on Suraj Kurapati's comments on the mailing list. commit 5831a1ce5ba5be7d9f55f36bfe9714715b0ecdf8 Author: Eric Wong Date: Fri Nov 13 18:32:24 2009 -0800 FAQ: additional notes on getting HTTPS redirects right commit b93cc4de233c9fb69c0c7f4967bdf9851fe4421a Author: Eric Wong Date: Fri Nov 13 18:11:46 2009 -0800 tee_input: fix comment from an intermediate commit commit e4256da292f9626d7dfca60e08f65651a0a9139a Author: Eric Wong Date: Sat Nov 14 00:23:19 2009 +0000 raise Unicorn::ClientShutdown if client aborts in TeeInput Leaving the EOFError exception as-is bad because most applications/frameworks run an application-wide exception handler to pretty-print and/or log the exception with a huge backtrace. Since there's absolutely nothing we can do in the server-side app to deal with clients prematurely shutting down, having a backtrace does not make sense. Having a backtrace can even be harmful since it creates unnecessary noise for application engineers monitoring or tracking down real bugs. commit 1b7b4d160610dd538eee624ef8eb8c6ed301a2b5 Author: Eric Wong Date: Sat Nov 14 00:23:18 2009 +0000 tee_input: don't shadow struct members It's confusing when a local variable reuses the same name as a struct member. commit 7e5942c3de1d79a6597443db5158b74c5253f6d3 Author: Eric Wong Date: Wed Nov 11 20:19:40 2009 -0800 tee_input: better premature disconnect handling Just let the error bubble all the way up to where Unicorn calls process_client where it'll be appropriately handled. Additionally, we'l just check the return value of tee() in ensure_length and avoid it if it nils on us. commit b398e1903bac5dd35ed088f73be5abe3b242d009 Author: Eric Wong Date: Wed Nov 11 14:35:12 2009 -0800 FAQ: fix links to Configurator docs commit c155a8f2370afa8287b31922b0e3c14d05f98c8c Author: Eric Wong Date: Wed Nov 11 14:32:38 2009 -0800 Add FAQ Hopefully this will help users and avoid redundant questions on the mailing list. commit 87995dec06334eb6a52d3f991a86bc191037d4b9 Author: Eric Wong Date: Wed Nov 11 14:05:25 2009 -0800 tee_input: fix RDoc argument definition for tee commit 560216c2fecfc5cf3489f749dc7a0221fd78eb26 Author: Eric Wong Date: Mon Nov 9 17:15:58 2009 -0800 Load Unicorn constants when building app This will benefit users of a copy-on-write-friendly memory manager provided with Ruby Enterprise Edition. Additionally, this will the reduce maintenance impact on Rainbows! in the future since load/require are not thread-safe under 1.9. commit 27744eed51e3a21786a9e3dcd0b83937e1047f60 Author: Eric Wong Date: Mon Nov 9 15:46:11 2009 -0800 local.mk.sample: steal some updates from Rainbows! Rack 1.0.1 is the current version, also make it easier to add more gems library paths in the future for testing even though Rack is the only thing we depend on right now. While we're at it, simplify and make it easier to modify for use with alternate prefixes. commit c0813d5c3307082dcc73a930e2de218aab8be235 Author: Eric Wong Date: Mon Nov 9 15:17:02 2009 -0800 don't nuke children for long after_fork and app loads Sometimes app loads and after_fork hooks can take a long time, even longer than shorter timeouts. Since timeouts are only meant for application processing when clients are involved, we won't nuke workers that have never chmodded before. commit d5908cae3da3b2fac66407ed1b34fb8e3f6551bb Author: Eric Wong Date: Mon Nov 9 10:20:25 2009 -0800 HACKING: update with "gmake" in examples Most GNU users already know their "make" is GNU make but it may not be obvious to non-GNU users. commit ebcd6658d92180a582f9d877fc8d6ec705545b69 Author: Eric Wong Date: Fri Nov 6 21:07:13 2009 -0800 unicorn.1: document RACK_ENV changes in 0.94.0