Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: ezyang@MIT.EDU (Edward Z. Yang)
Subject: [sup-talk] Sup is hanging
Date: Wed, 3 Jun 2009 17:48:56 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0906031740370.22220@javelin> (raw)
In-Reply-To: <1244064889-sup-9506@entry>

On Wed, 3 Jun 2009, William Morgan wrote:
> Reformatted excerpts from Edward Z. Yang's message of 2009-06-03:
>> The current working theory (based on strace'ing and lsof) is that Sup
>> is hanging on a select() call that doesn't have any timeout.  The
>> reason why this is hanging is because between opening the connection
>> and closing it, Sup does some ridiculously slow message parsing code
>> (that really thrashes the CPU) and by the time it's done the server
>> has closed the connection (but we don't know about it).
>
> That may all be true, but I'd be surprised if a) Sup didn't know that
> the server had closed the connection, and

It doesn't have anything to do with Sup: the system select() call is
hanging; Sup (and Ruby for that matter) is out of the equation. This
might be IMAP server weirdness, but that shouldn't cause Sup to
freeze.

> b) that this would cause the
> whole thing to hang.

That's what I find surprising, since Sup is multithreaded. I suppose
all of the threads are blocking on the select.

Sup hangs without -n. (it always hangs after it's "done fetching IMAP
headers"). "done fetching IMAP headers" is the last message we get.

The behavior seems to be:

1. Log reports "done fetching IMAP headers"

2. Sup begins malloc'ing like crazy. sup-sync still is able to catch
    signals and if you kill it you find that it's somewhere in
    lib/sup/message.rb, message_to_chunks. sup doesn't respond to Ctrl+C

3. After some minutes, CPU usage dies off, but Sup doesn't unfreeze.
    strace indicates that sup/sup-sync is waiting on a select(), and that
    the descriptors are TCP connections to the IMAP server.

Cheers,
Edward



  reply	other threads:[~2009-06-03 21:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 17:39 Edward Z. Yang
2009-06-03 18:11 ` William Morgan
2009-06-03 18:26   ` Edward Z. Yang
2009-06-03 18:21 ` Edward Z. Yang
2009-06-03 18:45   ` Edward Z. Yang
2009-06-03 21:36   ` William Morgan
2009-06-03 21:48     ` Edward Z. Yang [this message]
2009-06-04  2:11       ` William Morgan
2009-06-03 22:00     ` [sup-talk] Sup is hangingy Edward Z. Yang
2009-06-04  1:26       ` Edward Z. Yang
2009-06-04  1:53         ` [sup-talk] Sup is hangingyy Edward Z. Yang
2009-06-04 16:09           ` [sup-talk] Sup is hanging William Morgan
2009-06-05  5:08             ` Edward Z. Yang
2009-06-05 13:23               ` William Morgan
     [not found]               ` <1244227108-sup-3123@cabinet>
2009-06-05 21:47                 ` Edward Z. Yang
2009-06-06  6:20                   ` Edward Z. Yang
2009-06-08 18:09                     ` William Morgan
2009-06-04  2:12       ` [sup-talk] Sup is hangingy William Morgan
2009-06-04  2:13       ` William Morgan

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.0906031740370.22220@javelin \
    --to=ezyang@mit.edu \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox