Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
* Timeout on Rainbows!
@ 2013-08-23 19:13 Lin Jen-Shin (godfat)
       [not found] ` <CAA2_N1t7+9iGSGo-fzOuKFzxrtQkp==G0+8xOun3MfZ=rWq25A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Lin Jen-Shin (godfat) @ 2013-08-23 19:13 UTC (permalink / raw)
  To: Rainbows! list


I am reworking on thread pool for EventMachine, and just realized that
Rainbows doesn't try to put a timeout for each request. Previously,
I thought the timeout setup in Unicorn would be used for each request.

Then I found Rainbows::ThreadTimeout is probably what I want.
I wonder, does that make sense to do something like this, wrap the
application with Rainbows::ThreadTimeout with the same timeout
time in Unicorn automatically?

  def worker_loop worker
    build_app! # This is needed for preload_app=false
    server = Rainbows.server
    server.app = Rainbows::ThreadTimeout.new(server.app,
                   :timeout => server.config.set[:timeout])

I did this in my attempt for EventMachineThreadPool:

Because I saw this in EventMachine model:

  def worker_loop(worker) # :nodoc:
    server = Rainbows.server
    server.app.respond_to?(:deferred?) and
      server.app = TryDefer.new(server.app)

and I think in most cases we would want this timeout for each
request. The down side might be that then the users cannot
use their own Rainbows::ThreadTimeout (maybe?) or setup a custom

Probably then we could introduce another timeout/threshold config
in Configurator? I feel it would be common enough.

Thoughts? Thanks!
Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
Do not quote signatures (like this one) or top post when replying

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-23 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23 19:13 Timeout on Rainbows! Lin Jen-Shin (godfat)
     [not found] ` <CAA2_N1t7+9iGSGo-fzOuKFzxrtQkp==G0+8xOun3MfZ=rWq25A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-23 19:35   ` Eric Wong
     [not found]     ` <20130823193519.GA30201-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2013-08-23 20:02       ` Lin Jen-Shin (godfat)

Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).