about summary refs log tree commit homepage
DateCommit message (Collapse)
2009-04-03Add a test for signal recovery
I/O on slow descriptors can be interrupted so make sure we (and Ruby itself) are handling EINTR correctly.
2009-04-03configurator: allow hooks to be passed callable objects
Premade lambda/proc/Proc objects may all be passed, to the hooks, not just anonymous blocks.
2009-04-03test_helper: redirect_io uses append and sync
In case redirect_io is called multiple times, we don't want to lose debugging output.
2009-04-02unicorn 0.4.2 v0.4.2
2009-04-02GNUmakefile: "install" preserves unicorn_rails
This is to prevent the shebang line from being clobbered by setup.rb which does the rest of the heavy lifting. While we're at it, remove the dependency on git, too.
2009-04-02unicorn: remove unnecessary lambda generation
We can get by with one less lambda in the loader
2009-04-02Add log directories to tests
Not sure if unicorn_rails should create them since the builtin Rails server only creates things under tmp/*.
2009-04-02Use File.basename instead of a regexp
Just because I know regular expressions doesn't mean I *have* to use them...
2009-04-02test/rails: v2.1.2 + ActiveRecordStore all around
Recent changes made to the unicorn_rails loader were needed to get ActiveRecordStore to load correctly.
2009-04-02unicorn_rails: cleanup redundant bits
There were some unnecessary lambdas in there along with some repeated checks.
2009-04-02More descriptive process titles
Multiple Unicorn applications one machine can get confusing quickly. Regardless, make it easy to distinguish between workers and the master process.
2009-04-01test_upload: fix a race condition in unlink test
We need to ensure the next request has started processing before we can guarantee a temp file has been unlinked.
2009-04-01Close std{err,out} redirection targets
The newly open file descriptors live on as fd=1 and fd=2 anyways, so there's no reason to keep duplicates around.
2009-04-01FD_CLOEXEC all non-listen descriptors before exec
We'll allow before_exec to override that setting, however. There are cases where someone setting Logger.new("/path/to/file") will create new file descriptors in the master process. This will prevent FD leakage and a test case (for Linux only) proves it.
2009-04-01All IOs created in workers have FD_CLOEXEC set
Prevent subtle leaks here, too.
2009-04-01Remove set_cloexec wrapper and require FD_CLOEXEC
FD_CLOEXEC is POSIX and we only run on POSIX. Things will slowly leak over time if FD_CLOEXEC is not set, so raise the issue ASAP.
2009-04-01test_exec: add test case for per-worker listeners
2009-04-01Merge unicorn
* unicorn: unicorn 0.4.1
2009-04-01unicorn 0.4.1 v0.4.1
2009-04-01Manifest: updates
2009-04-01Add local.mk.sample file that I use
The real reason for Unicorn is to popularize GNU Make as a parallel programming platform :)
2009-04-01Documentation updates, prep for 0.4.1 release
2009-04-01Manifest update
2009-04-01test_rails: 4x speedup
Loading Rails takes a very long time, so consolidate most of the tests into one big test that allows us to avoid loading Rails. It makes the test less like unit tests, but they could still be split up into private functions if one wants to run them individually.
2009-04-01Add more tests for Rails
Additional tests for Rails have been added * cookies and sessions * POST requests * POST requests with multipart uploads * 404 handling * static file serving * cached static file serving (resources with ";" caching in some old 1.2.x version not yet tested)
2009-04-01cgi_wrapper: HTTP status code cleanups
The default status was 404 in Mongrel and this is needed to work with older versions of Rails. Additionally parse the "Status:" header if it ever got set and the actual "status" code passed to CGI::headers was not set.
2009-04-01GNUmakefile: prefix errors with $(extra) variable
Otherwise it's hard to tell which version of Rails test failed when we ran tests in parallel.
2009-04-01cgi_wrapper: fix cookies and other headers
The @output_cookies instance variable was being ignored, and some versions of Rails uses that. Additionally, cleanup multi-value headers in general to avoid dropping headers.
2009-03-31test: factor out exec helpers into common code for Rails tests
2009-03-31Rails stack tests for unicorn_rails
Very preliminary for now. Basically just sets up a basic controller and response. Requires git to clone the official Rails repository.
2009-03-31unicorn_rails: cleanup path mapping usage
Just use the RAILS_RELATIVE_URL_ROOT variable to support it since probably works on more versions of Rails. Since no application I've ever deployed has ever used it, I'm not going to bother supporting it for Rails <2.3, either.
2009-03-31Use {read,write}_nonblock on the pipe
Instead of trusting sysread/syswrite to throw EAGAIN if the pipe is full (highly unlikely); just use non-blocking methods which are indeed non-blocking and don't care for the #blocking= method added to it.
2009-03-31unicorn_rails: minor cleanup for dead variable
This removes half-implemented support to disable static file serving. People interested enough can provide their own config.ru file to save some stat(2) syscalls, but extra command-config options just complicate things.
2009-03-31configurator: remove unnecessary SocketHelper include
2009-03-31Better canonicalization of listener paths + tests
* Expand addresses like "1:8080" to "127.0.0.1:8080" beforehand so sock_name() in SocketHelper will always return consistent results. * Add support for "unix:/path/to/foo" paths for easier synchronization with nginx config files.
2009-03-30cgi_wrapper: ensure "Status:" header is not set
Rack does not like it; instead try to set it as the @status code if possible.
2009-03-30GNUmakefile: add test-exec and test-unit targets
This makes it easy to run unit or exec tests independently of the other. Removed the unused slow-tests targets.
2009-03-30unicorn_rails: give more info when aborting
Makes problems easier to solve if we dump the exception...
2009-03-30app/old_rails/static: define missing constant
REQUEST_METHOD got removed from Unicorn::Const and this module is the only place that currently uses it.
2009-03-30bin/*: parse CLI switches in config.ru sooner
This allows config.ru to specify listener and stuff before we setup the application.
2009-03-29test_exec: fix another race condition
2009-03-29Fix default listener setup
Combining command-line and config file options in a reasonable manner has and always will be a painful experience.
2009-03-29test_exec: fix response bodies
They were non-conformant for the longest time
2009-03-29test_exec: fix race conditions
We need to ensure the QUIT signal to the old processes are processed when fixing the config. Additionally, the log rotation checker was not reliable because the master log emitted a similar message to the workers and we were not distinguishing between them. Check for all 5 logs (1 master + 4 workers) to be rotated.
2009-03-29Avoid having two pid files pointing to the same pid
It makes test_exec more reliable and probably helps other scripts people may run around this.
2009-03-29http11: use :http_body instead of "HTTP_BODY"
"HTTP_BODY" could conflict with a "Body:" HTTP header if there ever is one. Also, try to hide this body from the Rack environment before @app is called since it is only used by Unicorn internally.
2009-03-29configurator: favor "listen" directive over "listeners"
We still need to support "listeners" for easy use of command-line options, but folks using the config file should use "listen" as it is more flexible.
2009-03-29configurator: per-listener backlog, {rcv,snd}buf config
Instead of having global options for all listeners, make all socket options per-listener. This allows reverse-proxies to pick different listeners to get different options on different sockets. Given a cluster of machines (10.0.0.1, 10.0.0.2, 10.0.0.3) running Unicorn with the following config: ------------------ 8< ---------------- listen "/tmp/local.sock", :backlog => 1 listen "*:8080" # use the backlog=1024 default ------------------ 8< ---------------- It is possible to configure a reverse proxy to try to use "/tmp/local.sock" first and then fall back to using the TCP listener on port 8080 in a failover configuration. Thus the nginx upstream configuration on 10.0.0.1 to compliment this would be: ------------------ 8< ---------------- upstream unicorn_cluster { # reject connections ASAP if we are overloaded server unix:/tmp/local.sock; # fall back to other machines in the cluster via "backup" # listeners which have a large backlog queue. server 10.0.0.2:8080 backup; server 10.0.0.3:8080 backup; } ------------------ 8< ---------------- This removes the global "backlog" config option which was inflexible with multiple machines in a cluster and exposes the ability to change SO_SNDBUF/SO_RCVBUF via setsockopt(2) for the first time.
2009-03-29TODO: update roadmap to 1.0.0
2009-03-29test_response: ensure response body is closed
This is in the Rack specification and a good idea. Remind ourselves to prevent file descriptor or other resource leaks in case the body is not an Array.