ChangeLog from git://git.bogomips.org/rainbows.git (0.1.1..0.2.0) commit 6611d1111d4e7cde671a77fa64348e4e9d8754db Author: Eric Wong Date: Thu Oct 15 00:42:39 2009 -0700 Rainbows! 0.2.0 This release adds preliminary Rev support for network concurrency under Ruby 1.8 and Ruby 1.9. There are caveats to this model and reading the RDoc for Rainbows::Rev is recommended. Rainbows::AppPool Rack middleware is now available to limit application concurrency on a per-process basis independently of network concurrency. See the RDoc for this class for further details. Per-client timeouts have been removed, see http://mid.gmane.org/20091013062602.GA13128@dcvr.yhbt.net for the reasoning. Rack environment changes: * "rack.multithread" is now only true for models with "Thread" in their name. Enabling thread-safe (but not reentrant) code may actually be harmful for Revactor. * "rainbows.model" is now exposed so the application can easily figure out which network concurrency model is in use. Bugfixes include better shutdown and error handling for all existing models, OpenBSD compatibility for the per-process heartbeat (same as found in unicorn v0.93.3). Eric Wong (53): add SIGNALS doc to RDoc SIGNALS: add Rainbows!-specific notes doc: better "Rainbows!" RDoc examples and linkage tests: generate random_blob once for all tests tests: move trash files to their own trash/ directory t0000: basic test includes keepalive + pipelining tests: simplify temporary file management tests: add dbgcat() utility method fchmod heartbeat flips between 0/1 tests: add revactor pipelining/keepalive test thread_spawn: trap EAGAIN on accept_nonblock thread_spawn: more robust loop thread_spawn: non-blocking accept() shouldn't EINTR tests: enable pipefail shell option if possible README for test suite tests: TEST_OPTS => SH_TEST_OPTS tests: update TRACER examples in makefile tests: create a bad exit code by default thread_spawn: clean up nuking of timed-out threads factor out common listen loop error handling graceful exit on trap TypeError from IO.select expand and share init_worker_process revactor: break on EBADF in the accepting actors revactor: cleanups and remove redundancy No need to be halving timeout, already done for us revactor: graceful death of keepalive clients revactor: continue fchmod beat in graceful exit cleanup thread models, threads no longer time out revactor: fix graceful shutdown timeouts Fix graceful shutdowns for threaded models SIGINT/SIGTERM shuts down instantly in workers tests: check for common exceptions with "Error" DEPLOY: update with notes on DoS potential tests: add reopen logs test for revactor vs Unicorn: use diagrams for concurrency models vs Unicorn: fix wording to be consistent with diagrams vs Unicorn: fix copy+paste errors and grammar fail README: alter reply conventions for the mailing list preliminary Rev support local.mk.sample: use ksh93 as default $(SHELL) rack.multithread is only true for Thread* models Rev: general module documentation + caveats Rev: fix error handling for parser errors t3003: set executable bit documentation updates (mostly on network models) rack: expose "rainbows.model" in Rack environment tests: enforce rack.multithread and rainbows.model README: update URLs README: update with Rev model caveats Add Rainbows::AppPool Rack middleware t4003: chmod +x local.mk.sample: use rev 0.3.1 instead README: link to AppPool and extra note about Rev model commit 43e8ff6bd83517ff1c81e8a35802f6e7a2a18788 Author: Eric Wong Date: Thu Oct 15 00:41:27 2009 -0700 README: link to AppPool and extra note about Rev model commit 3963b1da4cc1ebb12f492d8d060d0dfc6b64e748 Author: Eric Wong Date: Thu Oct 15 00:40:28 2009 -0700 local.mk.sample: use rev 0.3.1 instead rev 0.3.1 was just released tonight, lets use it since it squelches annoying warning messages. commit d3802f8dcca6904d6035898cc0c20e8c11b560cf Author: Eric Wong Date: Thu Oct 15 00:40:12 2009 -0700 t4003: chmod +x oops commit cbaa604582a9f80eba3fc0c2423234f497f21726 Author: Eric Wong Date: Thu Oct 15 00:37:59 2009 -0700 Add Rainbows::AppPool Rack middleware commit 537dffa88eeb7b573aa8176270f0635085de4706 Author: Eric Wong Date: Wed Oct 14 23:17:54 2009 -0700 README: update with Rev model caveats commit a021573cc31a438b8a81cba7707820dab7c593e1 Author: Eric Wong Date: Wed Oct 14 18:46:06 2009 -0700 README: update URLs commit 93a718202947e7d742c8c25f326631de84b4e44e Author: Eric Wong Date: Wed Oct 14 18:36:05 2009 -0700 tests: enforce rack.multithread and rainbows.model Help ensure apps get the correct Rack environment to make choices (if any) with. commit 0836409458e674d701f2be6c26aa85d441959562 Author: Eric Wong Date: Wed Oct 14 18:26:42 2009 -0700 rack: expose "rainbows.model" in Rack environment This allows applications to determine which concurrency model they're running under and possibly make adjustments accordingly. The standard "rack.multithread" isn't enough for some applications to determine what to do, especially when reentrancy is required/recommended. commit b14f5bcec7d9864faed7fcb06028eafe89a4a722 Author: Eric Wong Date: Wed Oct 14 18:25:15 2009 -0700 documentation updates (mostly on network models) commit 48dbd227580c592f1ae24054449b6da4490714ec Author: Eric Wong Date: Wed Oct 14 17:39:13 2009 -0700 t3003: set executable bit all test files should have the executable bit set commit 8b4a29032faac894f6702cc6160ef6366e739092 Author: Eric Wong Date: Wed Oct 14 17:39:12 2009 -0700 Rev: fix error handling for parser errors We should try to send 400s back to the client if possible. commit 57a1ae94c3ac0948737744b651d59945c1ac3099 Author: Eric Wong Date: Wed Oct 14 17:39:11 2009 -0700 Rev: general module documentation + caveats commit 6edaf2b720743fa0ce751b45a0923712b8ed5909 Author: Eric Wong Date: Wed Oct 14 17:39:10 2009 -0700 rack.multithread is only true for Thread* models Enabling thread-safe or thread-aware code paths in applications may even be dangerous in some cases and cause deadlocks in code that otherwise does not expect threads. This is especially true of the Revactor case where being a "drop-in" replacement for IO routines is dangerous if a mutex is held while an Actor performs a "blocking" I/O operation. Basically start to assume that anybody writing an app using Rev or Revactor already takes Rev/Revactor concurrency into account and won't need the rack.multithread flag set to do special things. commit 09eaa39fe7f1f5eb0a6d8aa4fab79afe6ff572a4 Author: Eric Wong Date: Wed Oct 14 17:39:09 2009 -0700 local.mk.sample: use ksh93 as default $(SHELL) It's faster than bash and the newer versions I have fixed a bug where the all-important pipefail option got dropped in subshells. commit 0a47b9209b6c677ad03ad2075f671883ca2b7474 Author: Eric Wong Date: Wed Oct 14 17:39:08 2009 -0700 preliminary Rev support There is no TeeInput (streaming request body) support, yet, as that does not seem fun nor easy to do (or even possible without using Threads or Fibers or something to save/restore the stack...) commit a42148fe4d62f812bc57418daecdb95f3c4d18cd Author: Eric Wong Date: Mon Oct 12 23:38:50 2009 -0700 README: alter reply conventions for the mailing list Mailman is now configured to munge Reply-To: to point back to the mailing list. This might make things easier for folks on low traffic mailing lists like ours. commit a33caf9313fd1bf79b36165bea2cae6e56da9b19 Author: Eric Wong Date: Mon Oct 12 17:30:51 2009 -0700 vs Unicorn: fix copy+paste errors and grammar fail commit f2c74fe47a9801c9b8b7520f9f55856528357e49 Author: Eric Wong Date: Mon Oct 12 14:46:38 2009 -0700 vs Unicorn: fix wording to be consistent with diagrams commit 0fb517107621961f08437f845cca9eabe7177ea8 Author: Eric Wong Date: Mon Oct 12 14:43:07 2009 -0700 vs Unicorn: use diagrams for concurrency models A picture is worth a thousand words, even in ASCII art. commit 4bb90cc3416b8c50870a5f2dd70dd2c5d53018f3 Author: Eric Wong Date: Mon Oct 12 01:53:02 2009 -0700 tests: add reopen logs test for revactor Just in case Rev/Revactor does weird things when faced with signals. commit 5fc6a745346517d1321b2e0b7ee0f6b7f88db5bd Author: Eric Wong Date: Mon Oct 12 01:13:20 2009 -0700 DEPLOY: update with notes on DoS potential commit 95bd43f95375c79255016f867b7cc524c6b27db8 Author: Eric Wong Date: Mon Oct 12 00:26:46 2009 -0700 tests: check for common exceptions with "Error" And fix existing tests that use "grep -v" since that is almost always true... commit 7096b494fac72a9b4444f2b5b7f32d3bdc17d44a Author: Eric Wong Date: Sun Oct 11 23:48:36 2009 -0700 SIGINT/SIGTERM shuts down instantly in workers Just like in Unicorn... commit a267b68ad921d115615abfc15de25a947e86fe38 Author: Eric Wong Date: Sun Oct 11 20:54:05 2009 -0700 Fix graceful shutdowns for threaded models They were completely broken in the refactoring :x commit 90a03ee550741465ea43fd70e087851e17246fb6 Author: Eric Wong Date: Sun Oct 11 20:42:21 2009 -0700 revactor: fix graceful shutdown timeouts commit df204a05d3a5bda8f716fa9f51be464fa59a3af1 Author: Eric Wong Date: Sun Oct 11 12:15:47 2009 -0700 cleanup thread models, threads no longer time out The process-based heartbeat continues, but we no longer time threads out just because a client is idle for any reason (for now). commit 4f8ae9abbb985a4091acbb7f57fb7f88fa2d43ba Author: Eric Wong Date: Sun Oct 11 02:35:48 2009 -0700 revactor: continue fchmod beat in graceful exit Avoid overloading the "alive" variable here and wakeup less frequently as well to do the fchmod. commit 512fd193d9f0e83d0233d239172b15915652f351 Author: Eric Wong Date: Sun Oct 11 02:29:16 2009 -0700 revactor: graceful death of keepalive clients We'll finish processing the current request and set the "Connection: close" header if possible. commit 89d5aa6894af87e055c118dc68bff340547abf5b Author: Eric Wong Date: Sun Oct 11 02:20:45 2009 -0700 No need to be halving timeout, already done for us In Unicorn by HttpServer#init_worker_process commit 36869925dbd73533a5b71ab0dfe838b371f420e1 Author: Eric Wong Date: Sun Oct 11 02:09:52 2009 -0700 revactor: cleanups and remove redundancy commit 7e7de6f43ca9c1e8d8ee2eae56578e31e22082e6 Author: Eric Wong Date: Sun Oct 11 02:02:26 2009 -0700 revactor: 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. commit 03b7904f597d80ed7c8e5ae19e2af8d0e0c581ba Author: Eric Wong Date: Sun Oct 11 01:51:27 2009 -0700 expand and share init_worker_process This can be common across everything commit 427ac38fe3eeadad1d6fb897bd835607a9372aad Author: Eric Wong Date: Sun Oct 11 01:37:20 2009 -0700 graceful exit on trap TypeError from IO.select Avoid potential race conditions with signal handlers, this makes exits cleaner since the LISTENERS array will get map!-ed to nils in the :QUIT signal handler. commit 178812e24edc3c912f7c2c13b37ab7f9e41d243c Author: Eric Wong Date: Sun Oct 11 01:34:34 2009 -0700 factor out common listen loop error handling It'll be easier to maintain a common language for logging and debugging. commit 3b0bf229c40a9e460b71e751932481e66e90c26a Author: Eric Wong Date: Sat Oct 10 15:57:12 2009 -0700 thread_spawn: clean up nuking of timed-out threads We log thread destruction times now and also make a best-effort to avoid race conditions on threads that just finished. commit 5a5493fefb9048a7362e3bcb629cc363df529422 Author: Eric Wong Date: Sat Oct 10 15:32:10 2009 -0700 tests: create a bad exit code by default In case the test doesn't complete and somehow doesn't write the exit code, we always want to start with one. commit 51c61aee1e194bc592225af63fe38fd7e6d799fb Author: Eric Wong Date: Sat Oct 10 12:58:12 2009 -0700 tests: update TRACER examples in makefile commit ff6bdcf72c94b4424b7ebf41b8c8bc5c7f81cdcc Author: Eric Wong Date: Sat Oct 10 12:48:11 2009 -0700 tests: TEST_OPTS => SH_TEST_OPTS These variables are only for shells in tests commit e81ba32115b9ba276ebf3c747f88a3c5f0bf4037 Author: Eric Wong Date: Sat Oct 10 12:45:57 2009 -0700 README for test suite commit 79b28210e3af5422002ef4ad79e77620295a4d38 Author: Eric Wong Date: Sat Oct 10 12:28:51 2009 -0700 tests: enable pipefail shell option if possible pipefail is extremely useful for detecting bad exits _anywhere_ in pipelines, not just the last command. Combined with "set -e", pipefail leads to very unforgiving scripts that bail out at the first sign of error, exactly what we want in tests. commit 1925c176d2b822c6c17aec472e318669f054beda Author: Eric Wong Date: Sat Oct 10 12:20:12 2009 -0700 thread_spawn: non-blocking accept() shouldn't EINTR Something is probably wrong with the OS if it does, so make sure it gets logged and hopefully reported. commit 5cf2c7d9543a9f25efb69e4693255c52678b0571 Author: Eric Wong Date: Sat Oct 10 12:14:25 2009 -0700 thread_spawn: more robust loop Bad stuff happens, even in our own code because sometimes we don't know what we're doing. So log it so we'll know to fix it and let life go on... commit 4dd4746437380f7971398dd4c6bb12cd5df112f3 Author: Eric Wong Date: Thu Oct 8 23:26:05 2009 -0700 thread_spawn: trap EAGAIN on accept_nonblock EAGAIN is common on accept_nonblock with multiple processes sharing the same listen descriptors. oops :x commit e65542f87b376b5e5b3d5f34fd43e9a8b2dfaff2 Author: Eric Wong Date: Thu Oct 8 23:24:19 2009 -0700 tests: add revactor pipelining/keepalive test Revactor model uses a different process_client method than our Thread* models. commit 966dee27d01b68283e80ea544c93f9a659145302 Author: Eric Wong Date: Thu Oct 8 20:28:00 2009 -0700 fchmod heartbeat flips between 0/1 This is for compatibility with OpenBSD as reported by Jeremy Evans for Unicorn. commit cc50dcc4918c82cee17d9715ec4bf2d588938042 Author: Eric Wong Date: Thu Oct 8 00:59:11 2009 -0700 tests: add dbgcat() utility method Useful for prefixing individual lines of a temporary file while catting it to stdout. This helps make tests easier to write and test. commit ee703a7af485ecdd2b8c96b0ad87f10d6b71a1fc Author: Eric Wong Date: Thu Oct 8 00:43:24 2009 -0700 tests: simplify temporary file management Since we rely heavily on temporary files in tests, make sure management of them is easy and reliable. commit be9e098dc8945e5abddc9a80fc38ce29fc813fc4 Author: Eric Wong Date: Wed Oct 7 23:57:56 2009 -0700 t0000: basic test includes keepalive + pipelining commit 9a439f77aada273a18fb473b84641e4611344ab5 Author: Eric Wong Date: Tue Oct 6 00:55:34 2009 -0700 tests: move trash files to their own trash/ directory Avoid cluttering the directory we write tests in commit a83f898b9faf193698185a89762d8eac08cc7736 Author: Eric Wong Date: Tue Oct 6 00:48:04 2009 -0700 tests: generate random_blob once for all tests We don't need to repeatedly waste cycles and memory bandwidth to generate random throwaway data. commit 6a08ae739570ec49046b48339a84997c3bff0cbb Author: Eric Wong Date: Mon Oct 5 23:54:31 2009 -0700 doc: better "Rainbows!" RDoc examples and linkage commit c9cb89612517c433b41c77de63f72a8e5c308a1b Author: Eric Wong Date: Mon Oct 5 22:56:52 2009 -0700 SIGNALS: add Rainbows!-specific notes Mainly need to note the unfortunate minor difference in log reopening semantics. commit ab8f1c63c8e0ba0a34526989fa2a17835e895a1a Author: Eric Wong Date: Mon Oct 5 22:47:32 2009 -0700 add SIGNALS doc to RDoc sort .document while we're at it so it's easier to scan