about summary refs log tree commit homepage
path: root/t
DateCommit message (Collapse)
2010-01-07Update docs + tests to reflect Rev 0.3.2 release
Rev 0.3.2 makes performance with Threads* under Ruby 1.8 tolerable.
2009-12-30EventMachine: support deferrables in responses
Some async apps rely on more than just "async.callback" and make full use of Deferrables provided by the EM::Deferrable module. Thanks to James Tucker for bringing this to our attention.
2009-12-29quiet spurious wakeups for accept() in Thread* models
Under all MRI 1.8, a blocking Socket#accept Ruby method (needs to[1]) translate to a non-blocking accept(2) system call that may wake up threads/processes unnecessarily. Unfortunately, we failed to trap and ignore EAGAIN in those cases. This issue did not affect Ruby 1.9 running under modern Linux kernels where a _blocking_ accept(2) system call is not (easily, at least) susceptible to spurious wakeups. Non-Linux systems running Ruby 1.9 may be affected. [1] - using a blocking accept(2) on a shared socket with green threads is dangerous, as noted in commit ee7fe220ccbc991e1e7cbe982caf48e3303274c7 (and commit 451ca6997b4f298b436605b7f0af75f369320425)
2009-12-22common Rainbows.sleep(nr) method
We'll export this across the board to all Rack applications to sleep with. This provides the optimum method of sleeping regardless of the concurrency model you choose. This method is still highly not recommended for pure event-driven models like Rev or EventMachine (but the threaded/fiber/actor-based variants are fine).
2009-12-22tests: enable RevFiberSpawn for 1.9
2009-12-22new RevFiberSpawn concurrency model
This is like the traditional FiberSpawn, but more scalable (but not necessarily faster) as it can use epoll or kqueue.
2009-12-08EventMachineDefer: preliminary (and) broken version
There's a good chunk of tests that fail with this, still. Worse, I haven't been able to figure out what's wrong since it looks like it would involve looking at C++ code...
2009-12-02add RevThreadPool concurrency model
This should be like RevThreadSpawn except with more predictable performance (but higher memory usage under low load).
2009-11-29preliminary NeverBlock support with EventMachine
2009-11-28tests: more stringent error checking in logs
If we logged "ERROR", we should know about it.
2009-11-28tests: +x broken app test, fix config file setup
2009-11-28always set FD_CLOEXEC if available
Some people fork processes, so it avoid hanging a connection open because of that...
2009-11-27tests: fix bugs with dash in GNUmakefile
One bad thing to defaulting to ksh93 for my tests during development, small cleanups while we're at it, too for extra checks
2009-11-27tests: no need to limit t9000 in multiple places
The test itself already exits immediately if it's running an incompatible concurrency model, so avoid having redundant logic in the GNUmakefile.
2009-11-26tests: enable AppPool test for Revactor and Fiber*
2009-11-26tests: "models" variable may be set in gmake CLI
This lets us make further tests for compatibility without dirtying our working tree.
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-26Fiber*: cleanup scheduling, fix keepalive
Both FiberSpawn and FiberPool share similar main loops, the only difference being the handling of connection acceptance. So move the scheduler into it's own function for consistency. We'll also correctly implement keepalive timeout so clients get disconnected at the right time.
2009-11-25AppPool middleware now compatible with Fibers
This enables the safe use of Rainbows::AppPool with all concurrency models, not just threaded ones. AppPool is now effective with *all* Fiber-based concurrency models including Revactor (and of course the new Fiber{Pool,Spawn} ones).
2009-11-25Fiber*: add Rainbows::Fiber.sleep method
It works exactly like Actor.sleep and similar to Kernel.sleep (no way to sleep indefinitely), but is compatible with the IO.select-based Fiber scheduler we run. This method only works within the context of a Rainbows! application dispatch.
2009-11-25add FiberPool concurrency model
This is another Fiber-based concurrency model that can exploit a streaming "rack.input" for clients. Spawning Fibers seems pretty fast, but maybe there are apps that will benefit from this.
2009-11-25add FiberSpawn concurrency model
This one seems a easy to get working and supports everything we need to support from the server perspective. Apps will need modified drivers, but it doesn't seem too hard to add more/better support for wrapping IO objects with Fiber::IO.
2009-11-24rework RevThreadSpawn without TeeInput and 1.8 support
Exposing a synchronous interface is too complicated for too little gain. Given the following factors: * basic ThreadSpawn performs admirably under REE 1.8 * both ThreadSpawn and Revactor work well under 1.9 * few applications/requests actually need a streaming "rack.input" We've decided its not worth the effort to attempt to support streaming rack.input at the moment. Instead, the new RevThreadSpawn model performs much better for most applications under Ruby 1.9
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-11tests: more stringent tests for error handling
Make sure any aborted/broken clients don't screw up our connection accounting.
2009-11-09tests: ensure we process "START" from FIFO when starting
Avoid the chances of misfiring when waiting on the master process to start in case something bad happens or we're sharing the FIFO for other purposes.
2009-11-09tests: heartbeat-timeout: simplify and avoid possible race
It seems possible to have a race condition here with the FIFO being overloaded for both start detection and blocking. Since SIGSTOP is unavoidable, just use that instead and sleep immediately afterwards in case SIGSTOP is not processed in time.
2009-11-09tests: ensure proper accounting of worker_connections
Counting worker connections is easy-to-forget when implementing new concurrency models and forgetting to do it means new clients cannot be accepted. Fortunately some concurrency models tend to do it for us.
2009-11-09rev_thread_spawn: 16K chunked reads work better
When reading 4K chunks, performance is dismal under 1.8
2009-11-09tests: extra check to avoid race in reopen logs test
In Unicorn, the master reopens logs before the workers do in case the workers die while reopening logs. But for our test cases (and real-world usage) we need to ensure the workers have reopened logs as well.
2009-11-09tests: add executable permissions to t0102
2009-11-08rev_thread_spawn/revactor: fix TeeInput for short reads
Explicitly requested short reads may cause too much data to be returned, which would be bad and potentially break the application. We need to ensure proper IO#readpartial-like semantics in both of these models.
2009-11-08initial cut of the RevThreadSpawn model
Seems to pass all tests, but that may only mean our test cases are lacking...
2009-11-07tests: sha1.ru now handles empty bodies
env['rack.input']read(length) may return nil zero-sized inputs
2009-11-07tests: allow use of alternative sha1 implementations
sha1sum(1) is only common GNU systems, and it may be installed as gsha1sum on *BSDs. We'll also try using the openssl sha1 implementation, too. And finally, we'll provide our own Ruby sha1sum.rb implementation as a last resort. We go to great lengths to avoid our own Ruby version because we want to avoid putting too much trust in ourselves, our Ruby skills, and even the Ruby implementations. This is especially with regard to our knowledge and correct usage of Ruby 1.9 encoding support. It would actually be *easier* to only use sha1sum.rb and call it a day. We just choose to support SHA1 implementations provided by third parties if possible. Performance is not a factor since sha1sum.rb performance is very close to the C implementations.
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-11-05t0100: more precise `expr` usage
It's also more portable since "+" isn't portable on FreeBSD.
2009-11-05ensure RACK_ENV is inherited from the parent env
Add tests to ensure we set it correctly and it gets passed down to the app.
2009-11-05tests: staggered trailer upload test
This test lead to two separate bugfixes in Unicorn, one in the HttpParser and the other in TeeInput. Ironically, this test was spawned from what I initially thought was a bug in the EvCore module used by Rev and EventMachine, but there was no bug in EvCore...
2009-11-05cleanup: remove unused t????.ru test files
2009-11-04t0004: tighten up timeout test
We've worked around trigger happy timeouts in the master since we track the timeout at a lower resolution here.
2009-11-01tests: make timeout tests reliable under 1.9
We need to resort to SIGSTOP to block off processes entirely since 1.9 uses native threads.
2009-10-31tests: avoid single backquote in echo
It's not portable to FreeBSD 7.2 /bin/sh
2009-10-30rev: split out heartbeat class
This module will be reused in upcoming Rev-derived concurrency models.
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-27test-lib: DWIM handling of temp UNIX sockets
2009-10-26tests: generate all dependencies atomically
Using a "+" suffix alone was not enough protection since we use evil recursive makes and can't share dependency info with parent makes. While this could be done more efficiently (even with recursive make), but it'd be harder to maintain. So we generate the dependencies later to and sacrifice efficiency on the initial run (but rarely/never again).
2009-10-26tests: error out if socat + curl aren't reachable
This makes it easier to figure out why tests are failing for people that forget to read t/README
2009-10-26tests: gracefully exit if EventMachine is not available
2009-10-26tests: only load Revactor tests under 1.9.1
Even though our tests do an extra check, it's faster to not unnecessarily invoke the check in the first place.