about summary refs log tree commit homepage
DateCommit message (Collapse)
2010-05-04Rainbows! 0.92.0 - inching towards the pot of gold v0.92.0
Mostly internal cleanups and small improvements. The only backwards incompatible change was the addition of the "client_max_body_size" parameter to limit upload sizes to prevent DoS. This defaults to one megabyte (same as nginx), so any apps relying on the limit-less behavior of previous will have to configure this in the Unicorn/Rainbows! config file: Rainbows! do # nil for unlimited, or any number in bytes client_max_body_size nil end The ThreadSpawn and ThreadPool models are now optimized for serving large static files under Ruby 1.9 using IO.copy_stream[1]. The EventMachine model has always had optimized static file serving (using EM::Connection#stream_file_data[2]). The EventMachine model (finally) gets conditionally deferred app dispatch in a separate thread, as described by Ezra Zygmuntowicz for Merb, Ebb and Thin[3]. [1] - http://euruko2008.csrug.cz/system/assets/documents/0000/0007/tanaka-IOcopy_stream-euruko2008.pdf [2] - http://eventmachine.rubyforge.org/EventMachine/Connection.html#M000312 [3] - http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin
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-04TODO: fix rdoc link
2010-05-04tee_input: remember "encoding: binary" comment
Even if it's just an empty file for now, it's critical in case we ever add any code that returns user-visible strings since Rack::Lint (and mere sanity) require binary encoding for "rack.input".
2010-05-04gemspec: bump Unicorn dependency
We expect no API changes in Unicorn for a while
2010-05-04local.mk.sample: isolate needs the correct Rake
2010-05-04doc: DEPLOY - more strongly recommend Rainbows!-only
Paragraph ordering matters psychologically.
2010-05-04eventmachine: "rack.multithread" is always true when deferring
Since deferred requests run in a separate thread, this affects the root (non-deferred) thread as well since it may share data with other threads.
2010-05-04drop EventMachineDefer concurrency model
Since we have conditional deferred execution in the regular EventMachine concurrency model, we can drop this one. This concurrency model never fully worked due to lack of graceful shut downs, and was never promoted nor supported, either.
2010-05-04SIGNALS: document app.deferred? caveat for graceful shutdown
There doesn't appear to be a good/easy way to do this with the built-in EventMachine thread pool :/
2010-05-04TODO: update EventMachine-related bits
2010-05-04eventmachine: add app.deferred?(env) support as middleware
Merb (and possibly other) frameworks that support conditionally deferred app dispatch can now use it just like Ebb and Thin. http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin
2010-05-03event_machine: update documentation for async frameworks
2010-05-03doc: misc updates
* avoid needless links to /Rainbows.html * keepalive_timeout has been 5 seconds by default for a while * update "Gemcutter" references to "RubyGems.org"
2010-05-03doc: RDoc 2.5.x updates
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-05-03max_body: remove extraneous debug message
2010-05-03t0100: rack-input-hammer tests identity encodings, too
It turns out we were painfully lacking in tests for HTTP requests where the Content-Length header _is_ set.
2010-05-03add client_max_body_size config directive
Since Rainbows! is supported when exposed directly to the Internet, administrators may want to limit the amount of data a user may upload in a single request body to prevent a denial-of-service via disk space exhaustion. This amount may be specified in bytes, the default limit being 1024*1024 bytes (1 megabyte). To override this default, a user may specify `client_max_body_size' in the Rainbows! block of their server config file: Rainbows! do client_max_body_size 10 * 1024 * 1024 end Clients that exceed the limit will get a "413 Request Entity Too Large" response if the request body is too large and the connection will close. For chunked requests, we have no choice but to interrupt during the client upload since we have no prior knowledge of the request body size.
2010-05-03t0401: do not leave lingering tail(1) processes
Since Rainbows! allows for graceful termination, let EM kill and reap the tail(1) processes it spawned.
2010-04-27gemspec: update comments for gem dependencies
2010-04-27dev: isolate: bump Unicorn test dependency
2010-04-27base: status == 100 check needs to_i conversion
Rack allows anything as the status, as long as it returns a valid status integer on status.to_i.
2010-04-19Merge branch 'maint'
* maint: Rainbows! 0.91.1 - use a less-broken parser from Unicorn
2010-04-19Rainbows! 0.91.1 - use a less-broken parser from Unicorn v0.91.1
This release fixes a denial-of-service vector for deployments exposed directly to untrusted clients. The HTTP parser in Unicorn <= 0.97.0 would trip an assertion (killing the associated worker process) on invalid Content-Length headers instead of raising an exception. Since Rainbows! and Zbatery supports multiple clients per worker process, all clients connected to the worker process that hit the assertion would be aborted. Deployments behind nginx are _not_ affected by this bug, as nginx will reject clients that send invalid Content-Length headers. The status of deployments behind other HTTP-aware proxies is unknown. Deployments behind a non-HTTP-aware proxy (or no proxy at all) are certainly affected by this DoS. Users are strongly encouraged to upgrade as soon as possible, there are no other changes besides this bug fix from Rainbows! 0.91.0 nor Unicorn 0.97.0 This bug affects all previously released versions of Rainbows! and Zbatery.
2010-04-19add test for the rack-fiber_pool gem with EventMachine
Although advertised as being Thin-only, the rack-fiber_pool gem works with our EventMachine concurrency model as well. Note that it's impossible to expose the streaming "rack.input" behavior of the native FiberSpawn/FiberPool models via middleware, but most people don't need streaming a "rack.input" See http://github.com/mperham/rack-fiber_pool for more details on the rack-fiber_pool gem.
2010-04-19use the excellent `isolate' gem for dev
It should make life easier when dealing with and testing complex dependencies, especially ones like Cramp which depend on prerelease versions of gems.
2010-04-19rev/deferred_response: cleanup and simplification
We can use the new HttpResponse.header_string method now instead of writing an empty body.
2010-04-19use IO.copy_stream for Thread{Spawn,Pool} under 1.9
This should be faster for serving static files and proxying IO objects such as sockets/pipes. Unfortunately we cannot use this reliably with non-blocking frameworks since IO.copy_stream will release the GVL to block on I/O (rather than yielding a fiber or returning from a callback). Can't do HTTP/1.1 Range support, though :/
2010-04-19http_response: split out header stringification code
This will make it easier to use body#to_path if possible since some concurrency models like EventMachine have optimized code paths for serving static files.
2010-04-02rainbows/http_*: remove unnecessary circular requires
http_response and http_server are never NOT loaded when "rainbows" is required.
2010-04-02use duck typing for REMOTE_ADDR detection
This gives us the option to use non-TCPSocket-derived IO-ish objects in the future, whatever that may be...
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-03-28fiber/base: do not modify hash during iteration (1.9.2dev)
It's generally dangerous to do so regardless of language and Ruby 1.9.2dev is stricter about this sort of behaviour.
2010-03-28local.mk.sample: bump neverblock test dep to 0.1.6.2
It continues to work with the old espace version from GitHub repos, too.
2010-03-26async_examples/async_app: avoid needless UTF-8
Unicorn stopped reading all config.ru files as binary starting with 0.97.0 for compatibility with rackup(1), so systems that defaulted to US-ASCII encoding would have trouble running this.
2010-03-01Rainbows! 0.91.0 - Unicorn resync v0.91.0
Unicorn 0.97.0 has a bunch of internal cleanups and small fixes and this is mainly to resync with those changes. keepalive_timeout now defaults to 5 seconds (from 2 seconds previous). This should help out clients on slower connections. Some small fixes and cleanups: * Rainbows::Fiber::IO objects may leak if a rare app uses them explicitly with FiberSpawn/FiberPool-only (not RevFiberSpawn) * quiet down ENOTCONN handling, there's nothing we can do about this error so we won't fill our logs with it.
2010-02-28rainbows: remove redundant check for $DEBUG
2010-02-28let Unicorn.builder parse switches in config.ru
Less code for us is better
2010-02-27keepalive_timeout defaults to 5 seconds
The previous 2 second default was not enough for folks on slow connections where our OS socket buffers would've masked the time it took to write out larger responses. ref: <20100219220904.GA11377@dcvr.yhbt.net>
2010-02-27ev_core: avoid needless String#dup
Just create an empty string instead and let Unicorn::HttpParser allocate it internally to whatever size is needed.
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
2010-02-27TCPSocket#peeraddr may raise ENOTCONN
Since we deal with untrusted/non-local clients, those clients may disconnect at inopportune times and leave us with ENOTCONN when we try to call getpeername(2)
2010-02-26avoid leaks if app uses Rainbows::Fiber::IO
For the very rare apps out there using Rainbows::Fiber::IO, the FiberSpawn and FiberPool (but not RevFiberSpawn) models could leak memory if the app-created Rainbows::Fiber::IO objects were dereferenced without being removed from the RD/WR hashes.
2010-02-26revactor/tee_input: sync w/ Unicorn::TeeInput struct-ification
commit a5f4d11cdb9465b1ffa2892b3d84ee53b8962930 in unicorn.git switched all ivars to struct members for ease-of-hacking and object size.
2010-02-24switch to Unicorn.builder, depend on Unicorn 0.97.0+
The Unicorn.builder helper will help us avoid namespace conflicts inside config.ru, allowing us to pass tests. While we're at it, port some tests over from the latest unicorn.git for dealing with bad configs.
2010-02-20test-lib: make FIFO start check an after_fork hook
enabling ready_pipe in Unicorn 0.96.0 breaks this.
2010-02-20test-lib: remove needless fd closing
too dangerous with the ready_pipe feature in Unicorn 0.96+