Files | Admin

Notes:

Release Name: 0.3.0

Notes:
Rainbows! is a HTTP server for sleepy Rack applications.  It is based on
Unicorn, but designed to handle applications that expect long
request/response times and/or slow clients.  For Rack applications not
heavily bound by slow external network dependencies, consider Unicorn
instead as it simpler and easier to debug.

* http://rainbows.rubyforge.org/
* rainbows-talk@rubyforge.org
* git://git.bogomips.org/rainbows.git

Changes:

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 (38):
      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
      Rainbows! 0.3.0



Changes: GIT-VERSION-GEN | 2 +- TODO | 15 ++ TUNING | 14 ++ lib/rainbows.rb | 7 + lib/rainbows/app_pool.rb | 7 +- lib/rainbows/base.rb | 28 ++-- lib/rainbows/const.rb | 6 +- lib/rainbows/dev_fd_response.rb | 69 ++++++++ lib/rainbows/http_response.rb | 1 + lib/rainbows/http_server.rb | 2 + lib/rainbows/rev.rb | 179 +++++++++++++++----- lib/rainbows/revactor.rb | 20 +-- lib/rainbows/thread_pool.rb | 24 ++-- lib/rainbows/thread_spawn.rb | 8 +- local.mk.sample | 10 +- t/GNUmakefile | 8 +- t/README | 2 +- t/async-response-no-autochunk.ru | 24 +++ t/async-response.ru | 13 ++ t/bin/content-md5-put | 2 +- t/bin/utee | 12 ++ t/env.ru | 3 + t/large-file-response.ru | 13 ++ t/lib-async-response-no-autochunk.sh | 6 + t/lib-async-response.sh | 45 +++++ t/lib-graceful.sh | 40 +++++ t/lib-input-trailer.sh | 63 +++++++ t/lib-large-file-response.sh | 45 +++++ t/lib-parser-error.sh | 29 +++ ...actor-tee-input.sh => lib-rack-input-hammer.sh} | 12 +- t/lib-reopen-logs.sh | 60 +++++++ t/lib-simple-http.sh | 92 ++++++++++ t/sleep.ru | 19 ++- t/t0000-basic.sh | 37 +---- t/t1000-thread-pool-basic.sh | 42 +----- t/t1002-thread-pool-graceful.sh | 37 +---- t/t1003-thread-pool-reopen-logs.sh | 2 + t/t1004-thread-pool-async-response.sh | 1 + t/t1005-thread-pool-large-file-response.sh | 1 + t/t1006-thread-pool-async-response-no-autochunk.sh | 1 + t/t1100-thread-pool-rack-input.sh | 2 + t/t1101-thread-pool-input-trailer.sh | 2 + t/t2000-thread-spawn-basic.sh | 38 +---- t/t2002-thread-spawn-graceful.sh | 37 +---- t/t2003-thread-spawn-reopen-logs.sh | 2 + t/t2004-thread-spawn-async-response.sh | 1 + t/t2005-thread-spawn-large-file-response.sh | 1 + ...006-thread-spawn-async-response-no-autochunk.sh | 1 + t/t2100-thread-spawn-rack-input.sh | 2 + t/t2101-thread-spawn-input-trailer.sh | 2 + t/t3000-revactor-basic.sh | 40 +----- t/t3001-revactor-pipeline.sh | 46 ----- t/t3002-revactor-graceful.sh | 38 +---- t/t3003-revactor-reopen-logs.sh | 54 +------ t/t3004-revactor-async-response.sh | 1 + t/t3005-revactor-large-file-response.sh | 2 + t/t3006-revactor-async-response-no-autochunk.sh | 1 + t/t3100-revactor-rack-input.sh | 2 + t/t3101-revactor-rack-input-trailer.sh | 2 + t/t4000-rev-basic.sh | 51 +------ t/t4002-rev-graceful.sh | 52 +------ t/t4003-rev-parser-error.sh | 34 +---- t/t4003-rev-reopen-logs.sh | 2 + t/t4004-rev-async-response.sh | 1 + t/t4005-rev-large-file-response.sh | 2 + t/t4006-rev-async-response-no-autochunk.sh | 1 + t/t4100-rev-rack-input.sh | 44 +----- t/t4101-rev-rack-input-trailer.sh | 51 +------ t/t9000-rack-app-pool.sh | 5 +- t/test-lib.sh | 98 +++++++++-- 70 files changed, 895 insertions(+), 721 deletions(-) commit 25c0b000d50ed65e5118b17725334be916e93f47 Author: Eric Wong Date: Mon Oct 19 11:13:34 2009 -0700 Rainbows! 0.3.0 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 commit da59c30e7265d2718110286f226e6b4caaaa766c Author: Eric Wong Date: Mon Oct 19 11:09:22 2009 -0700 local.mk.sample: sync with BDFL's version commit 8453ad07c53907a54283a8eddc423840e0d9649c Author: Eric Wong Date: Sat Oct 17 16:02:24 2009 -0700 TODO: update with new items commit eba5b17340c24cf70e09f7d8fe381691e32feb9e Author: Eric Wong Date: Mon Oct 19 10:20:34 2009 -0700 TUNING: update documentation notes commit 9c5ce5b2f86591977727b7fdaa8fcc50aea089d6 Author: Eric Wong Date: Mon Oct 19 10:20:33 2009 -0700 rev: update documentation for this model commit 77e526918d16caffdee371f96a3fbc40f8e95dcb Author: Eric Wong Date: Sun Oct 18 23:53:02 2009 -0700 rev: AsyncResponse => DeferredResponse API cleanup 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. commit dbb2e039fac19d9b74075fd79cddade534cafeca Author: Eric Wong Date: Sun Oct 18 23:09:09 2009 -0700 tests: predictable and simpler tempfile management 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. commit 9922b5e683e86c6df48931ee90da1c5e6ad419ef Author: Eric Wong Date: Sun Oct 18 22:11:39 2009 -0700 tests: DWIM FIFO creation If we're going to name a variable "fifo", it'll be for descriptive reasons... commit c41a08821bf11eefebda3ea3e536eda8f4b4629b Author: Eric Wong Date: Sun Oct 18 22:05:13 2009 -0700 tests: more reliable error checking We now check for SIGKILL, too commit 7b01d94dd9287ac402d91451f1e93c9faaf913c4 Author: Eric Wong Date: Sun Oct 18 15:59:29 2009 -0700 rev: async response bodies with DevFdResponse middleware 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. commit d0103759ae63b0ed1084f6a9d2b7ede538e8c871 Author: Eric Wong Date: Sun Oct 18 20:08:17 2009 -0700 revactor: 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. commit 87a9cf757bbef7bb54a187933c1bc61ed1f05583 Author: Eric Wong Date: Sun Oct 18 20:04:57 2009 -0700 rev: fix heartbeat timeouts Oops, looks like they were never implemented at all. commit 1a1335fe5b1894848b48a233c9f6a80634329b40 Author: Eric Wong Date: Sun Oct 18 09:35:59 2009 -0700 http_response: filter out X-Rainbows-* headers We'll be using some custom headers to craft responses commit 1c0dab453688e8bfc9f21656e9b89b88fb3cc1d3 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: for log reopening for all concurrency models commit 49981da0edf3cb142079ee9341640bd5b798c880 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: rack.input hammer concurrency testing commit 61a50566ea0799a9b19c3dcfdf9b1ae5ea083dd2 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: common basic HTTP tests for all models We support pipelining, keepalive, and even HTTP/0.9! commit 0719c5a7ac09078c810507244a86ba44623757c4 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 rev: avoid stack overflow through pipelining 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... commit b4d479681c257d91c7784a6698264719632be374 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 rev: handle fully-buffered, pipelined requests This leaves us vulnerable to stack overflows through excessive pipelining. The next patch will fix things hopefully. commit 2dd23ad0a97d8818eba8298acd8c51405725b099 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: DRY require tests for Rev/Revactor commit 926bf35b9ead1224ae3037fabb58625de9a66d98 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 test-lib: quiet down pipefail error message We'll spit out a proper warning later anyways... commit 49806778ce03114cb2e29b1adc53020de2299abe Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: DRY Ruby requires based on model commit 3a5af445e2a3af83cd2e7e68b2d4c0d1dc8079b5 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: DRY setting of the "model" environment var commit c50132e156da457186929e5c36d9e16f636f48df Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: factor out a common parser error "library" commit cd91835b826b968df08ae1bcde794a9d54334182 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: fix random_blob dependency commit caddc46054b720bd88757b0c15de1d305216fa77 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: fix issues with non-portable shell constructs At least these tests all run with dash now, but ksh93 or bash is still recommended for pipefail commit b32e9240ec68f2493038c5cfbc9ca6859cca6ad8 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: rack.input trailer tests for all models Just in case we break something. Also add staggered blob test to simulate slow client uploads. commit 95417ca711a75612da86a25acd20134efdbc0e67 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: add unbuffered tee(1)-like helper Buffering enabled in tee(1) was making tests more difficult to debug. commit b68b53c0323f691dbc412fa5ff581ff0b9a7ef1f Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: introduce require_for_model function This makes it easier to write/share code for multi-model tests. commit a764983fccd6cce64043d76e09a5e1718e7f8fd6 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 refactor 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. commit 71a1cf90ce16ce6951f1ce76fcea98b13bc54576 Author: Eric Wong Date: Sat Oct 17 22:42:56 2009 -0700 tests: sleep.ru slurps rack.input stream Since we do "Expect: 100-continue" handling, make sure we read anything in the request body the client will send us. commit ce5bb179bcd0ac2921da636375cb3821b79c428c Author: Eric Wong Date: Sat Oct 17 22:42:55 2009 -0700 Rev: simplification to error handling on_write_complete has no chance of being called there so remove the unnecessary ensure statement commit d838e5ef01471eb12aec42639246946f7b3da4a5 Author: Eric Wong Date: Sat Oct 17 22:42:55 2009 -0700 use timeout correctly to join threads on SIGQUIT Subtraction is a difficult concept for some folks (like myself) to grasp and implement. commit 394e1aa79d16ed9405e35e3cd3749a7e8c51522a Author: Eric Wong Date: Sat Oct 17 22:42:55 2009 -0700 test-lib: dbgcat adds headers with key name Makes it easier to track down empty files this way commit b79ce7e6594259669763251e3cbf4404a6381d7c Author: Eric Wong Date: Sat Oct 17 22:42:55 2009 -0700 DRY setting of rack.multithread It's more fool-proof this way and prevents us from using idiotic/non-obvious concurrency model names. commit e0c33c583c5b4d2a4661edb6c41d6a60b44dae9d Author: Eric Wong Date: Sat Oct 17 22:42:55 2009 -0700 Fix graceful shutdown handling of Thread* models harder I need better tests for graceful shutdown... commit 031127b1d047d05be7a2ec8af7480d02e9bbdd69 Author: Eric Wong Date: Sat Oct 17 22:42:55 2009 -0700 tests: sleep.ru handles "Expect: 100-continue" commit 7a3ebef424f3e7db0a48ae35885c446d79b7d971 Author: Eric Wong Date: Sat Oct 17 22:42:55 2009 -0700 Revactor tests can sleep more easily Since we export "rainbows.model" to Rack now, we don't have to worry about setting the "SLEEP_CLASS" env for the application. commit 08c52c81bc49023a645dd211c4c983a60ac64e13 Author: Eric Wong Date: Thu Oct 15 13:42:07 2009 -0700 app_pool: note it being currently broken with Revactor 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...