Ah, I see Oren has a more useful response! Thanks, Oren! On Thu, May 12, 2011 at 3:08 PM, Peter van Hardenberg <p...@heroku.com>wrote:
> Sorry -- you're going to have to figure out the Sinatra stuff yourself. > Based on my "here let me google that for you" investigation, it sounds like > Sinatra only started handling SIGTERM correctly in 1.1, so you could look at > the source for that and monkeypatch accordingly. > > Regards, > Peter > > > On Thu, May 12, 2011 at 1:11 PM, midwaltz <ste...@gmail.com> wrote: > >> Interesting, thanks Peter. Yes, that's probably worth documenting. >> >> Two questions: >> >> - Are requests in the queue somehow pre-assigned to a specific dyno? >> I'm asking because I'm testing this behavior on a bare sinatra app >> with a get handler that sleeps for 0.5 seconds and then returns 'OK'. >> In other words the request takes half a second, so according to you it >> should be quick enough to finish before being sent a SIGKILL. But I >> keep seeing those errors, so I'm guessing either Sinatra panics and >> kills itself on SIGTERM, or maybe it's a queue thing? I'll be happy to >> share the code I'm using to make the tests if you'd like. (I'm using >> the default Sinatra gem (not specifying a version) on the bamboo- >> ree-1.8.7 stack). >> >> - How do I catch a SIGTERM during a Sinatra app request? >> >> >> >> >> >> >> On May 12, 10:15 am, Peter van Hardenberg <p...@heroku.com> wrote: >> > We normally send a SIGTERM, then wait five (ish?) seconds to let the >> last >> > request serve and then, then send SIGKILL if the process still hasn't >> gone >> > away. >> > >> > You can confirm this behaviour here by catching and logging the SIGTERM >> in >> > your app and then reproducing the situation you describe. If you can >> provide >> > a test-case that shows you're not seeing expected behaviour (I use it >> > extensively in one of my test apps) I'll make a ticket gets filed >> against >> > the Runtime. Otherwise, maybe there's somewhere we can improve our >> > documentation here. >> > >> > Regards, >> > >> > Peter >> > Heroku >> > >> > >> > >> > >> > >> > >> > >> > On Wed, May 11, 2011 at 8:49 PM, midwaltz <ste...@gmail.com> wrote: >> > >> > > When decreasing Dynos while they are busy, some of them return a 503 >> > > status error with Heroku error code H13 (Connection closed without >> > > response >> > >http://devcenter.heroku.com/articles/error-codes#h13__connection_clos. >> .. >> > > ). >> > >> > > I can only speculate, but to me it looks like instead of waiting for >> > > the Dyno to finish sending its request, the Dyno is killed right away. >> > >> > > After a quick Googling I found out this bug might have been known for >> > > a while: >> > >http://www.continuousthinking.com/2010/11/3/heroku-autoscaling-bug >> > > (except the error status codes look different, but it might have been >> > > a misstep?). >> > >> > > What's the status on fixing this bug? >> > >> > > Cheers, >> > > Steph >> > >> > > -- >> > > You received this message because you are subscribed to the Google >> Groups >> > > "Heroku" group. >> > > To post to this group, send email to heroku@googlegroups.com. >> > > To unsubscribe from this group, send email to >> > > heroku+unsubscr...@googlegroups.com. >> > > For more options, visit this group at >> > >http://groups.google.com/group/heroku?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Heroku" group. >> To post to this group, send email to heroku@googlegroups.com. >> To unsubscribe from this group, send email to >> heroku+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/heroku?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to heroku@googlegroups.com. To unsubscribe from this group, send email to heroku+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.