about summary refs log tree commit homepage
path: root/lib/rainbows/revactor.rb
DateCommit message (Collapse)
2010-07-10doc: avoid documenting internals on RDoc website
Since we suck at building websites, we just rely on RDoc as a website builder. And since Rainbows! is an application server (and not a programming library), our internal API should be of little interest to end users. Anybody interested in Rainbows! (or any other project) internals should be reading the source.
2010-07-04refactor response body handling for sendfile(2)
This hopefully allows the "sendfile" gem to be required anywhere in the Rainbows!/Unicorn config file, and not have to be required via RUBYOPT or the '-r' command-line switch. We also modularize HttpResponse and avoids singleton methods in the response path. This (hopefully) makes it easier for individual concurrency models to share code and override individual methods.
2010-07-04revactor: properly zero buffer on zero reads
While we're at it, fix a comment, too.
2010-06-28(style) prefer "until" instead of "while !"
2010-06-28revactor: constant/namespace cleanups
2010-06-28base: constant/namespace cleanup
2010-06-18prefer Array#[] lookup to Array#first/Array#last
Array#[] lookups are slightly faster under both rbx and 1.9, and easier to read.
2010-05-04revactor: match IO behavior for readpartial wrapper
IO#readpartial on zero bytes will always return an empty string, so ensure the emulator for Revactor does that as well.
2010-05-03cleanup request size limiting for TeeInput users
WAvoid mucking with Unicorn::TeeInput, since other apps may depend on that class, so we subclass it as Rainbows::TeeInput and modify as necessary in worker processes. For Revactor, remove the special-cased Rainbows::Revactor::TeeInput class and instead emulate readpartial for Revactor sockets instead.
2010-03-28cleanup: avoid redundant REMOTE_ADDR logic
Every concurrency model does this the same way. This removes the Rainbows::Const::LOCALHOST constant and may break some existing apps that rely on it.
2010-02-27don't bother supporting platforms without FD_CLOEXEC
No point in having extra code around for platforms we don't care about.
2010-02-27revactor: cleanups to avoid instance_eval
instance_variable_{set,get} are faster, but equally ugly
2010-02-27revactor: document our EMFILE handling strategy
2009-12-16cleanup: consolidate write_nonblock error handling
2009-12-11env["hack.io"] for Fiber*, Revactor, Thread* models
This exposes a client IO object directly to the underlying application.
2009-12-01more consistent code for worker timeout/exits
We now correctly exit!(2) if our master can't kill us.
2009-12-01revactor: avoid unbounded memory growth :x
This model has basically been rewritten to avoid unbounded memory growth (slow without keepalive) due to listeners not properly handling :*_closed messages. Performance is much more stable as a result, too.
2009-11-28always set FD_CLOEXEC if available
Some people fork processes, so it avoid hanging a connection open because of that...
2009-11-26cleanup and refactor error handling
Make sure app errors get logged correctly, and we no longer return a 500 response when a client EOFs the write end (but not the read end) of a connection.
2009-11-18make keepalive_timeout configurable
And change the default to 2 seconds, most clients can render the page and load all URLs within 2 seconds.
2009-11-18revactor: :timeout for reading headers in TCP sockets
We'll be getting a keepalive_timeout setting soon, clients with 300 second idle keepalives are ridiculous and Ruby objects are still not that cheap in 1.9
2009-11-11cleanup error handling pieces
Unicorn 0.94.0 got a more generic handle_error function that's useful in the Thread* models. The Revactor one is a little different but similar to be worth refactoring to match our standard pieces.
2009-11-06cleanup worker heartbeat and master deathwatch
It turns out neither the EventMachine and Rev classes checked for master death in its heartbeat mechanism. Since we managed to forget the same thing twice, we now have a test case for it and also centralized the code to remove duplication.
2009-10-27revactor: require 0.1.5, remove 0.1.4 workarounds
Also new are added basic HTTP tests for UNIX domain socket handling (for all models, now, of course).
2009-10-18revactor: switch to a 1 second heartbeat
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.
2009-10-17refactor graceful shutdowns again, harder
We use the "G" global constant from the Rev model everywhere to simplify things a little. Test cases are more consistent now, too.
2009-10-14documentation updates (mostly on network models)
2009-10-11revactor: fix graceful shutdown timeouts
2009-10-11revactor: continue fchmod beat in graceful exit
Avoid overloading the "alive" variable here and wakeup less frequently as well to do the fchmod.
2009-10-11revactor: graceful death of keepalive clients
We'll finish processing the current request and set the "Connection: close" header if possible.
2009-10-11revactor: cleanups and remove redundancy
2009-10-11revactor: break on EBADF in the accepting actors
Once our listeners get closed, we're as good as dead so we should exit to avoid spinning.
2009-10-11expand and share init_worker_process
This can be common across everything
2009-10-11factor out common listen loop error handling
It'll be easier to maintain a common language for logging and debugging.
2009-10-08fchmod heartbeat flips between 0/1
This is for compatibility with OpenBSD as reported by Jeremy Evans for Unicorn.
2009-10-05huge documentation revamp
2009-10-04revactor: graceful exit if a listening actor dies
It's usually a bad sign if we have unhandled exceptions in the listener loops, so we'll exit just in case.
2009-10-04revactor: implement actor limiting
While we're at it, make it properly 100% message-driven so there's no more busy-waiting and polling for dead actors, No we just wait for client actors to die off and resume listener actors if they stopped accepting.
2009-10-04revactor: allow UNIX domain socket listeners
Revactor may be gaining support for UNIX domain socket listeners soon, so factor out revactorize_listeners into its own method that can conditionally handle UNIX domain sockets if our Revactor version supports it. Patch for Revactor submitted here: http://rubyforge.org/pipermail/revactor-talk/2009-October/000035.html
2009-10-03common Base class for all concurrency models
They're similar enough (especially as far as the constants go) and allows a :Base to be used which basically acts like plain Unicorn but with HTTP keepalive + pipelining support
2009-10-03revactor: workaround for Revactor still using Rev::Buffer
Patch submitted upstream: http://rubyforge.org/pipermail/revactor-talk/2009-October/000034.html
2009-10-02set "encoding: binary" for all files
2009-10-02initial revision
No tests yet, but the old "gossamer" and "rainbows" branches seem to be basically working.