Date | Commit message (Collapse) |
|
Instead of sleeping and waiting for a PID file to appear,
just use a named-pipe and block on it in the test scripts
since we know Unicorn won't attempt to fork until sockets
are already bound.
|
|
It's more common form for externally-visible/modifiable
variables in Makefiles and shell scripts.
|
|
Ensure our workers are capable of processing requests before we
can continue to setup signal handlers. The later "kill -USR1"
signal may fire in our test script before the workers have a
chance to setup the handlers. So by the time we receive a
positive response, we _know_ signal handlers are ready.
|
|
utee is line-oriented on _read_, so avoid messing with
that for this. Additionally, spawn our FIFO cats before
we start writing gobs of data out since it could cause
the writers to block otherwise.
|
|
Working for simple GET requests, completely untested otherwise
and most definitely not able to handle async/Comet-style
requests yet, either. No tests for this are enabled.
This could share a lot of code with the existing Rev model.
|
|
The cmp test was completely unnecessary and
pointless.
|
|
While we're at it, remove trailing whitespace for
author names, too.
|
|
Since HTTP/0.9 responses have no headers to write, the
on_write_complete handler we rely on never got triggered,
leading to additional reads to never get queued up.
Additionally, we need to explicitly detect and close client
sockets if we've written the last response body since HTTP/0.9
clients never know when it's time to close a connection.
|
|
Don't try to clobber FIFOs at startup since sometimes traps may
not fire. And while we're at it, avoid trying to unlink them
twice.
|
|
The extra CRLF is not needed for HTTP/0.9
|
|
Revactor was our first take on the "rainbows" branch of Unicorn
and probably less confusing to people that may have tracked that
branch. ThreadPool was used in the "gossamer" branch of Unicorn
before, but since this project is named Rainbows!, it's less
logical. I'll freely admit to having some personal bias here
and not being a fan of threads (and especially not pthreads!).
|
|
This was blindly copied and pasted from the Revactor code.
|
|
The major feature of this release is the new DeferredResponse
middleware for the Rev-based concurrency model. It should be
transparently compatible with non-Rev models, as well. As a
pleasant side effect, this change also allows large files to be
streamed to the client with Rev as the socket becomes writable
instead of slurping the entire file into an IO::Buffer first.
Bugfixes to graceful shutdowns support for all concurrency
models. The Rev-based model also gets a working heartbeat
mechanism (oops!) and fixed HTTP/1.1 pipelining support.
Eric Wong (37):
app_pool: note it being currently broken with Revactor
Revactor tests can sleep more easily
tests: sleep.ru handles "Expect: 100-continue"
Fix graceful shutdown handling of Thread* models harder
DRY setting of rack.multithread
test-lib: dbgcat adds headers with key name
use timeout correctly to join threads on SIGQUIT
Rev: simplification to error handling
tests: sleep.ru slurps rack.input stream
refactor graceful shutdowns again, harder
tests: introduce require_for_model function
tests: add unbuffered tee(1)-like helper
tests: rack.input trailer tests for all models
tests: fix issues with non-portable shell constructs
tests: fix random_blob dependency
tests: factor out a common parser error "library"
tests: DRY setting of the "model" environment var
tests: DRY Ruby requires based on model
test-lib: quiet down pipefail error message
tests: DRY require tests for Rev/Revactor
rev: handle fully-buffered, pipelined requests
rev: avoid stack overflow through pipelining
tests: common basic HTTP tests for all models
tests: rack.input hammer concurrency testing
tests: for log reopening for all concurrency models
http_response: filter out X-Rainbows-* headers
rev: fix heartbeat timeouts
revactor: switch to a 1 second heartbeat
rev: async response bodies with DevFdResponse middleware
tests: more reliable error checking
tests: DWIM FIFO creation
tests: predictable and simpler tempfile management
rev: AsyncResponse => DeferredResponse API cleanup
rev: update documentation for this model
TUNING: update documentation notes
TODO: update with new items
local.mk.sample: sync with BDFL's version
|
|
|
|
|
|
|
|
|
|
The "async" moniker wasn't appropriate since this API also
handles static files without slurping, so "deferred" is a more
appropriate term (even if I have trouble speling words with
double conssonants in them).
The DeferredResponse.write method now emulates the
HttpResponse.write method for consistency.
|
|
Instead of using completely random names, we'll use
predictable ones since we already depend on them for
exit codes and such. This drops our ability to run
the same test for the same version of Ruby in the
same working tree, but that's an unlikely scenario.
While we're at it, avoid remove tempfiles if a test
failed. This should make debugging easier.
|
|
If we're going to name a variable "fifo", it'll be for
descriptive reasons...
|
|
We now check for SIGKILL, too
|
|
This new middleware should be a no-op for non-Rev concurrency
models (or by explicitly setting env['rainbows.autochunk'] to
false).
Setting env['rainbows.autochunk'] to true (the default when Rev
is used) allows (e)poll-able IO objects (sockets, pipes) to be
sent asynchronously after app.call(env) returns.
This also has a fortunate side effect of introducing a code path
which allows large, static files to be sent without slurping
them into a Rev IO::Buffer, too. This new change works even
without the DevFdResponse middleware, so you won't have to
reconfigure your app.
This lets us epoll on response bodies that come in from a pipe
or even a socket and send them either straight through or with
chunked encoding.
|
|
Like everybody else... Closing the listener sockets doesn't seem
to wakeup the actors reliably and since it's easier to use a 1
second heartbeat than correct signal/messaging for all the rest
of the other clients, we'll just do that instead of relying on
one-off signal handlers.
|
|
Oops, looks like they were never implemented at all.
|
|
We'll be using some custom headers to craft responses
|
|
|
|
|
|
We support pipelining, keepalive, and even HTTP/0.9!
|
|
Handling HTTP pipelining through recursion is not good since
several hundred kilobytes worth of GET/HEAD requests can be a
LOT of GET/HEAD requests...
|
|
This leaves us vulnerable to stack overflows through excessive
pipelining. The next patch will fix things hopefully.
|
|
|
|
We'll spit out a proper warning later anyways...
|
|
|
|
|
|
|
|
|
|
At least these tests all run with dash now, but ksh93
or bash is still recommended for pipefail
|
|
Just in case we break something. Also add staggered
blob test to simulate slow client uploads.
|
|
Buffering enabled in tee(1) was making tests more
difficult to debug.
|
|
This makes it easier to write/share code for multi-model tests.
|
|
We use the "G" global constant from the Rev model everywhere
to simplify things a little.
Test cases are more consistent now, too.
|
|
Since we do "Expect: 100-continue" handling, make sure
we read anything in the request body the client
will send us.
|
|
on_write_complete has no chance of being called
there so remove the unnecessary ensure statement
|
|
Subtraction is a difficult concept for some folks (like
myself) to grasp and implement.
|
|
Makes it easier to track down empty files this way
|
|
It's more fool-proof this way and prevents us from using
idiotic/non-obvious concurrency model names.
|
|
I need better tests for graceful shutdown...
|
|
|
|
Since we export "rainbows.model" to Rack now, we don't
have to worry about setting the "SLEEP_CLASS" env for
the application.
|
|
Revactor does not use threads and blocking on a stock Queue
class does not work. Eventually this should be made to work
with the Actor model, but until then, we'll at least document
it...
|