about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2013-01-11event_machine: join reactor_thread if it is already running
...rather than falling through worker_loop Prior to the application of this patch, if an EventMachine reactor_thread has already been started elsewhere before the worker_loop is entered, the worker_loop exits as a second call to EM.run does not block the current thread. This patch causes the worker_loop thread to join the reactor_thread if it is running. [ew: commit message formatting] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2012-12-19event_machine: cleanup confusing assignment
2012-12-18event_machine: avoid close on deferred response
close_connection_after_writing only if not deferred, as in cool.io Deferred responses may buffer more data down the line, so keep the connection alive if we have a deferred response body. [ew: clear @deferred when we really want to quit, updated commit message] Acked-by: Eric Wong <normalperson@yhbt.net>
2012-12-06Rainbows! 4.4.2 - EventMachine async.callback fix v4.4.2
One bugfix allows stream(:keep_open) in Sinatra to work properly. Thanks to W. Andrew Loe III for the informative bug report and reproducible test case. ref: http://mid.gmane.org/CA+-9oNd1EFqsniPkkPTwu5opTCinbM7-2KHoXov7+y3LE4s4Tg@mail.gmail.com
2012-12-05event_machine: properly defer body.close for async
Calling body.close in the normal write_response() code path is incorrect, and only worked out of sheer luck with Cramp and async_sinata. This change allows stream(:keep_open) in Sinatra to work properly. Thanks to W. Andrew Loe III for the informative bug report and reproducible test case. ref: http://mid.gmane.org/CA+-9oNd1EFqsniPkkPTwu5opTCinbM7-2KHoXov7+y3LE4s4Tg@mail.gmail.com
2012-08-31Rainbows! 4.4.1 - a minor bugfix for Fiber users v4.4.1
Fiber-based concurrency options avoids negative sleep intervals. Thanks to Lin Jen-Shin for pointing this out.
2012-08-27fiber/base: avoid negative sleep interval
Also clarify the code while we're at it. Thanks to Lin Jen-Shin for pointing this out. ref: http://mid.gmane.org/CAA2_N1unOXb7Z4Jr8oKoSLu266O9Ko4o=oWzAcMA1w3=9X74KA@mail.gmail.com
2012-08-18Rainbows! 4.4.0 - minor improvements v4.4.0
For epoll/Cool.io-based concurrency models, shutdown() is now used to timeout keepalive clients to avoid race conditions. Minor documentation improvements.
2012-07-19thread_timeout: document additional caveats
Again, for the one thousandth time, timing out threads is very tricky business :<
2012-07-01coolio+xepoll_thread*: use shutdown() for keepalive timeout
Triggering Errno::EBADF is tricky in multithreaded situations due to possible race conditions and yet-to-be discovered bugs. shutdown(2) is also safe against apps the fork() internally but do not execve(2) nor set FD_CLOEXEC. n.b. calling fork() after pthreads are spawned may not be safe on all platforms w.r.t. malloc, but /is/ the case for glibc on GNU/Linux. Follow-up-to: commit a5b987619f4b793203f6a50e424fe98c5b0794ba
2012-06-18epoll*: favor shutdown(2) for keepalive timeout
Triggering Errno::EBADF is tricky in multithreaded situations due to possible race conditions and yet-to-be discovered bugs. shutdown(2) is also safe against apps the fork() internally but do not execve(2) nor set FD_CLOEXEC. n.b. calling fork() after pthreads are spawned may not be safe on all platforms w.r.t. malloc, but /is/ the case for glibc on GNU/Linux.
2012-05-09fiber_pool: take Fibers from larger pools faster
Array#pop can be significantly faster than Array#shift on large arrays (especially since we push into the Array). This is because Array#shift needs to shift all elements in the array, and Array#pop only needs to shorten the array by one element. The Fiber stack may also be hotter in CPU caches when we choose the most-frequently used stack.
2012-05-09stream_response_epoll: fix for unicorn 4.3.x
unicorn 4.3.x now calls shutdown() explicitly on the socket, so we can't just rely on a dup()-ed FD to keep a socket around.
2012-04-12doc: some spelling fixes
Found with rdoc-spellcheck
2011-10-12http_server: fix log message if using Base (no concurrency)
Telling the user worker_connections=50 when using the Base concurrency model is misleading.
2011-09-02Rainbows! 4.3.1 - small bugfix v4.3.1
This release fixes a potential reentrancy deadlock when using the default logger from the Ruby standard library.
2011-08-30avoid potential Logger deadlock in SIGQUIT and SIGUSR1
If any combination of SIGQUIT and SIGUSR1 are sent to a Rainbows! worker in a /very/ short period of time, the Mutex used by the default Logger implementation may deadlock since Mutex synchronization is not reentrant-safe. Users of alternative logger implementations (or monkey-patched ones) are possibly not affected. Users of the logger_mp_safe.rb monkey-patch distributed[1] with unicorn are not affected. [1] http://unicorn.bogomips.org/examples/logger_mp_safe.rb
2011-08-20Rainbows! 4.3.0 - pull in changes from unicorn 4.1.0 v4.3.0
The deprecated Rainbows::HttpResponse class is finally gone thanks to Pratik Naik. Logging of errors is more consistent with the changes in unicorn 4.1.0. There are also minor documentation updates. See the unicorn 4.1.0 release notes for more details: http://bogomips.org/unicorn.git/tag/?id=v4.1.0
2011-08-20rdoc: cleanup and stop depending on :enddoc:
It doesn't seem to work at the top of the file...
2011-08-19event_machine: update rdoc for new Cramp homepage
Cramp has a homepage and mailing list now, yay!
2011-08-16more consistent logging for errors
The Unicorn.log_error method exists since 4.0.0
2011-08-05Remove deprecated Rainbows::HttpResponse
Acked-by: Eric Wong <normalperson@yhbt.net>
2011-08-05Rainbows! 4.2.0 - Cramp WebSocket updates! v4.2.0
This release includes updates to support WebSockets under Cramp 0.14 and later. This will be the last release which supports Cramp 0.13. There are no changes in this release for non-Cramp users.
2011-08-05event_machine: APP needs to be in the main Client class
Oops, testing against new changes against cramp.git here
2011-08-05event_machine: add :em_client_class option
This can allow Cramp (and potentially other libraries) to subclass or implement duck-type compatible versions of Rainbows::EventMachine::Client.
2011-07-30Rainbows! 4.1.0 - minor internal cleanups v4.1.0
There are only some minor cleanups in this release and a bump to kgio 2.5 to remove the dependency on io/wait. kgio 2.5 or later is now required (kgio 2.6+ will be required in the next release).
2011-07-21remove tcp_nodelay/tcp_nopush tweaking
Unicorn 4.x already defaults match those of Rainbows! to favor lower latency instead of lowered bandwidth usage.
2011-07-21remove unnecessary io/wait require
kgio 2.5 added kgio_wait_*able methods
2011-06-29Revert "http_server: cap timeout at 32-bit LONG_MAX seconds"
Unicorn (> 4.0.1) already handles this for us, not that it affects many people... This reverts commit 37c376a9253ed62d134cbb4dbc6eaecc6076c77e.
2011-06-28Fix Fiber* and WriterThread* breakage from removing io/wait
This fixes up breakage introduced in commit 905f0ff393629ddb4d70e3dc221b016128c47415 to switch to kgio for timed, synchronous waiting.
2011-06-28require kgio 2.5 for kgio_wait_readable(timeout)
Since kgio_wait_*able in kgio 2.5 takes an optional timeout argument, we no longer have to load the extra "io/wait" module. This saves us a small amount of some memory and also removes the extra ioctl(FIONREAD) syscall IO#wait enforces. Like IO#wait in Ruby 1.9.3dev, kgio_wait_readable may use ppoll() to wait on high-numbered file descriptors as efficiently as it waits on low-numbered descriptors.
2011-06-27http_server: cap timeout at 32-bit LONG_MAX seconds
We can't wait for longer than 68 years.
2011-06-27Rainbows! 4.0.0 - MOAR concurrency for MOAR COARS v4.0.0
Rainbows! now scales to more than 1024 worker processes without special privileges. To enable this, Rainbows! now depends on Unicorn 4.x and thus raindrops[1]. client_max_header_size directive is added to limit per-client memory usage in headers. An experimental StreamResponseEpoll concurrency option now exists to buffer outgoing responses without any thread-safe dependencies. Unlike the rest of Rainbows! which works fine without nginx, this concurrency option is /only/ supported behind nginx, even more strongly so than Unicorn itself. non-nginx LAN clients are NOT supported for this. This relies on the sleepy_penguin[2] RubyGem (and Linux). There are some minor bug fixes and cleanups all around. See "git log v3.4.0.." for details. [1] http://raindrops.bogomips.org/ [2] http://bogomips.org/sleepy_penguin/
2011-06-27remove unused arg in Rainbows::Response.setup
It hasn't been used in a while, but we kept it for Zbatery version compatibility.
2011-06-22epoll/client: properly close on all pipe responses
Some pipe responses can trigger the on_deferred_write_complete method without ever re-running the event loop. This appears to be the result of the occasional t0050 failures.
2011-06-22dev_fd_response: enable under Rubinius
Untested, but it should work nowadays...
2011-06-22Unicorn 4.x resync for ticker
This removes the extra per-process file descriptor and replaces it with Raindrops.
2011-06-15remove IO_PURGATORY dependency
We no longer need to put all listeners away since Unicorn uses kgio.
2011-06-11configurator: add client_max_header_size directive
Lowering this will lower worst-case memory usage and mitigate some denial-of-service attacks. This should be larger than client_header_buffer_size. The default value is carried over from Mongrel and Unicorn.
2011-06-11doc: remove docs for Rainbows::Fiber::* APIs
Do not encourage their use, really.
2011-06-10stream_response_epoll: update documentation
Yes, this concurrency model is our strangest yet.
2011-06-11remove Rainbows.run method
We can get away with a single stack frame reduction. Unicorn itself has more stack reductions, but Rainbows! is further behind in this area.
2011-06-10ev_core: do not autochunk HTTP/1.0 (and 0.9) responses
Do not assume middlewares/applications are stupid and blindly add chunking to responses (we have precedence set by Rack::Chunked).
2011-06-10ev_core: use add_parse for trailers, too
HttpParser#trailers and #headers are actually the same method, so we'll just continue on.
2011-06-10use HttpParser#add_parse API in Unicorn 3.7.0
It's easier-to-use in some cases.
2011-06-09response: sendfile_range fis for Rack::File in rack 1.3.0
Rack::File already sets Content-Range, so don't repeat work and reparse Content-Length.
2011-06-09stream_response_epoll: our most "special" concurrency option yet
This doesn't use Rainbows::Base so we have no keepalive support at all. This could eventually be an option for streaming applications.
2011-06-09move reopen_worker_logs to base
We may not always use Rainbows! :Base since we don't want keepalive/immediate log reopening in some cases.
2011-05-31xepoll_thread_*: update docs for Linux 3
Linux 3.0.0 is just around the corner and of course newer than 2.6.
2011-05-21use and recommend sleepy_penguin 3.0.1
It's better under 1.9.3 (sleepy_penguin 3.0.1 was bogus)