From: Bharanee Rathna <deepfryed@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: unicorn stuck in sched_yield after ERESTARTNOHAND
Date: Wed, 1 Jun 2011 10:31:22 +1000 [thread overview]
Message-ID: <BANLkTinsXbKt2g5HZG0a3Q4Gr7D05HRRjA@mail.gmail.com> (raw)
In-Reply-To: <20110531234829.GA9815@dcvr.yhbt.net>
thanks for the quick response eric,
On Wed, Jun 1, 2011 at 9:48 AM, Eric Wong <normalperson@yhbt.net> wrote:
> Bharanee Rathna <deepfryed@gmail.com> wrote:
>> I'm encountering a weird error where the unicorn workers are stuck in
>> a loop after hitting a 500 on the backend sinatra app.
>
> Also, what extensions are you using in your app?
heaps of em. yajl, swift, rmagick, fastcaptcha, flock, nokogiri &
curb. except swift and curb none of the others would be touching the
network.
>> strace at the point where it starts to go into a loop of death
>
>> select(7, [4 5], NULL, [3 6], {30, 0}) = 1 (in [5], left {27, 274382})
>> fchmod(8, 01) = 0
>> fcntl(5, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
>> accept4(5, {sa_family=AF_INET, sin_port=htons(56728),
>> sin_addr=inet_addr("10.1.1.4")}, [16], SOCK_CLOEXEC) = 12
>> recvfrom(12, 0x1c99fb0, 16384, 64, 0, 0) = -1 EAGAIN (Resource
>> temporarily unavailable)
>
> (I'm somewhat more awake, now, haven't been sleeping much)
>
> Two things look off in the line above:
>
> 1) recvfrom() isn't using the MSG_DONTWAIT flag. I know you're using
> Linux, so kgio should be using MSG_DONTWAIT to do non-blocking
> recv... Which versions of unicorn/kgio are you using?
using kgio 2.3.2, i'll upgrade it and give it another try
>
> 2) TCP_DEFER_ACCEPT should prevent recvfrom() from hitting EAGAIN
> in the common case under Linux.
>
>> select(13, [12], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
>> --- SIGINT (Interrupt) @ 0 (0) ---
>> rt_sigreturn(0x2) = -1 EINTR (Interrupted system call)
>
> What triggered SIGINT?
not sure
>
> Actually, after many lines of sched_yield() in your gist, I can see it
> does actually exit the process. Did you kill it with SIGINT? If so, I
> see nothing wrong...
yes i killed it after the worker looked stuck and wasn't responding for 30s
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
next prev parent reply other threads:[~2011-06-01 0:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <BANLkTikFid3n0QpsrnXf2oNansFmuJDyuw@mail.gmail.com>
[not found] ` <BANLkTimF78PW9YgEAURS604Q8mucNwSDrg@mail.gmail.com>
2011-05-31 12:02 ` unicorn stuck in sched_yield after ERESTARTNOHAND Bharanee Rathna
2011-05-31 15:17 ` Eric Wong
2011-05-31 22:28 ` Bharanee Rathna
2011-05-31 23:48 ` Eric Wong
2011-06-01 0:31 ` Bharanee Rathna [this message]
2011-06-01 0:44 ` Bharanee Rathna
2011-06-01 16:48 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTinsXbKt2g5HZG0a3Q4Gr7D05HRRjA@mail.gmail.com \
--to=deepfryed@gmail.com \
--cc=mongrel-unicorn@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
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).