about summary refs log tree commit homepage
DateCommit message (Collapse)
2009-11-21unicorn 0.95.1 v0.95.1
Configuration files paths given on the command-line are no longer expanded. This should make configuration reloads possible when a non-absolute path is specified for --config-file and Unicorn was deployed to a symlink directories (as with Capistrano). Since deployments have always been strongly encouraged to use absolute paths in the config file, this change does not affect them. This is our first gem release using gemcutter. Eric Wong (3): SIGNALS: HUP + preload_app cannot reload app code Do not expand paths given on the shell GNUmakefile: prep release process for gemcutter
2009-11-21GNUmakefile: prep release process for gemcutter
2009-11-18Do not expand paths given on the shell
Shells already expand '~' before the executables see it, and relative paths inside symlinks can get set incorrectly to the actual directory name, and not the (usually desired) symlink name for things like Capistrano. Since our paths are now unexpanded, we must now check the "working_directory" directive and raise an error if the user specifies the config file in a way that makes the config file unreloadable.
2009-11-18SIGNALS: HUP + preload_app cannot reload app code
This is already documented in Configurator RDoc, but put it here just in case people don't read all the documentation.
2009-11-15unicorn 0.95.0 v0.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
2009-11-15tee_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.
2009-11-15Rakefile: add raa_update task
2009-11-15ClientShutdown: RDoc
2009-11-15socket_helper: RDoc for constants
2009-11-15socket_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.
2009-11-15replace "rescue => e" with "rescue Object => e"
"Object" is needless noise and some folks are annoyed by seeing it.
2009-11-15tee_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.
2009-11-15test_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.
2009-11-14const: 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.
2009-11-14old_rails: autoload Static
It makes life easier for people writing config.ru files for use with Rails.
2009-11-14old_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).
2009-11-14preserve 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.
2009-11-14configurator: 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
2009-11-13bump version to 0.95.0pre
We need a minor version since we will expose Unicorn::ClientDisconnect.
2009-11-13configurator: update RDoc and comments in examples
Some of this based on Suraj Kurapati's comments on the mailing list.
2009-11-13FAQ: additional notes on getting HTTPS redirects right
2009-11-13tee_input: fix comment from an intermediate commit
2009-11-13raise 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.
2009-11-13tee_input: don't shadow struct members
It's confusing when a local variable reuses the same name as a struct member.
2009-11-11tee_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.
2009-11-11FAQ: fix links to Configurator docs
2009-11-11Add FAQ
Hopefully this will help users and avoid redundant questions on the mailing list.
2009-11-11tee_input: fix RDoc argument definition for tee
2009-11-09Load 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.
2009-11-09local.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.
2009-11-09don'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.
2009-11-09HACKING: 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.
2009-11-06unicorn.1: document RACK_ENV changes in 0.94.0
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.