Date | Commit message (Collapse) |
|
|
|
No point in making syscalls to deal with empty bodies.
Reinstate usage of the NULL_IO object which allows us
to avoid allocating new objects.
|
|
This fixes a long-standing bug where listeners would be removed
from the known listener set during a reload but never correctly
shut down (until reexec).
Additionally, test_server was working around this bug (my fault,
subconciously) as teardown did not unbind the socket, requiring
the tests to grab a new port.
|
|
|
|
This reworks error handling throughout the entire stack to be
more Ruby-ish. Exceptions are raised instead of forcing the
us to check return values.
If a client is sending us a bad request, we send a 400.
If unicorn or app breaks in an unexpected way, we'll
send a 500.
Both of these last-resort error responses are sent using
IO#write_nonblock to avoid tying Unicorn up longer than
necessary and all exceptions raised are ignored.
Sending a valid HTTP response back should reduce the chance of
us from being marked as down or broken by a load balancer.
Previously, some load balancers would mark us as down if we close
a socket without sending back a valid response; so make a best
effort to send one. If for some reason we cannot write a valid
response, we're still susceptible to being marked as down.
A successful HttpResponse.write() call will now close the socket
immediately (instead of doing it higher up the stack). This
ensures the errors will never get written to the socket on a
successful response.
|
|
|
|
unused_port is more reliable as it actually tries to bind
a port and retries if it fails. This is also safe across
parallel unicorn tests running in different directories.
|
|
While we'll support anything that exposes a Rack-like interface
(a very good one IMHO), we shouldn't have a hard dependency on
Rack to simplify testing.
While we're at it, I'm not using Daemons anymore, either,
since that does too many things behind our back as far as
daemonization goes.
As a result of not depending on Rubygems, either, I've sped
up my "make -j" test ~1.5 seconds
|
|
Use select(2) to multiplex non-blocking accept(2) calls between
them. Additionally, aggressively make a bet after accepting
clients where we'll try to do a non-blocking accept(2) against
the full set of descriptors. This is based on the assumption
that if we just accepted connections, we're probably reasonably
busy.
This should lead to lower latency under high load; but some
wasted cycles when requests come in intermitently. By this same
logic, we don't really care for the thundering herd problem,
either; since it is only noticeable with many (hundreds) of
processes when most of them are idle.
|
|
All tests for threading and semaphores have been removed. One
test was changed because it depended on a shared variable.
Tests will be replaced with tests to do process management
instead.
|
|
Avoid conflicting with existing Mongrel libraries since
we'll be incompatible and break things w/o disrupting
Mongrel installations.
|
|
|
|
|
|
|