unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: David Nghiem <david@zendesk.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: unicorn 1.1.x never-ending listen loop IOError exceptions
Date: Tue, 22 Mar 2011 17:04:48 -0700	[thread overview]
Message-ID: <AANLkTim=xPJ6Mo9160FvCBzh+RwLnsiOkb51WAhJmmV0@mail.gmail.com> (raw)
In-Reply-To: <20110322213905.GA23207@dcvr.yhbt.net>

On Tue, Mar 22, 2011 at 2:39 PM, Eric Wong <normalperson@yhbt.net> wrote:

>> I don't get any other exceptions.  I've found other people have this
>> "IOError: closed stream" error coupled with "Errno::EMFILE" but we
>> have plenty of file-descriptors left.
>
> No Errno::EBADF errors at all?

I didn't check before or after the block of Errno::IOError errors,
there were enough IOError logs to fill up 40gb of disk.  I'll capture
the entire deleted log next time.


> <snip>  It looks like log reopening failed, below:
>
>> ruby    15209 zendesk    1w   REG              252,0           0
>> 3015360 /data/zendesk/log/unicorn.stdout.log
>> ruby    15209 zendesk    2w   REG              252,0       24585
>> 3015203 /data/zendesk/log/unicorn.stderr.log-20110110 (deleted)
>> ruby    15209 zendesk    3w   REG              252,0 61617590073
>> 3015097 /data/zendesk/log/unicorn.log-20110110 (deleted)
>
> Permissions issue during log rotation?  Are you doing "killall -USR1
> unicorn" by any chance or sending a bunch of USR1 signals faster than
> unicorn can process them?
>
> Try just sending one USR1 to the master process and letting the master
> signal the workers.

We rotate logs once a night using logrotate.  There's a post-rotate
hook that sends USR1 once to the master.   There are three log files
but logrotate is run with the sharedscripts option so only one hook
runs.  The log dirs and unicorn processes are run as the same non-root
user.

I'll run an lsof on the healthy workers next time to see if they have
the same deleted log file descriptors.

Are the IOError exceptions and failure to rotate logs related?  My
wild guess was this specific worker's unix socket got corrupted
somehow.
_______________________________________________
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


  reply	other threads:[~2011-03-23  0:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 19:19 unicorn 1.1.x never-ending listen loop IOError exceptions David Nghiem
2011-03-22 21:39 ` Eric Wong
2011-03-23  0:04   ` David Nghiem [this message]
2011-03-23  1:09     ` Eric Wong
     [not found]       ` <AANLkTim3xZMKxcmQzPjcB7vrJKiHoc2f8WoU8RatrDum@mail.gmail.com>
2011-03-29 16:24         ` Eric Wong
2011-03-29 16:54           ` [PATCH] add examples/logrotate.conf 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='AANLkTim=xPJ6Mo9160FvCBzh+RwLnsiOkb51WAhJmmV0@mail.gmail.com' \
    --to=david@zendesk.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).