All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: Re: [tabled patch 1/1] Fix spinning if EOF from client
Date: Fri, 14 May 2010 22:02:51 -0400	[thread overview]
Message-ID: <4BEE00CB.6070900@garzik.org> (raw)
In-Reply-To: <20100511220954.3bb154a0@redhat.com>

On 05/12/2010 12:09 AM, Pete Zaitcev wrote:
> I observed that Tabled sometimes starts spinning on CPU. It happens when
> it manages to receive a EOF from client (reads zero bytes from the socket).
>
> The fix is to treat EOF as an error and simply dispose of the cli.
>
> However, we need to know when there are no bytes to be read from
> a socket that is still open. To that end we modify the API of cli_read:
> now it only returns zero in case of EOF, and passes -EAGAIN up.
>
> In order to prevent busy spinning for slow clients, callers of cli_read
> return false to the dispatch loop in case of -EAGAIN.
>
> Note that this patch assumes that zero bytes is always EOF, and that
> we receive -EAGAIN if there is nothing to read in the first place.
>
> Signed-off-by: Pete Zaitcev<zaitcev@redhat.com>

applied


      reply	other threads:[~2010-05-15  2:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12  4:09 [tabled patch 1/1] Fix spinning if EOF from client Pete Zaitcev
2010-05-15  2:02 ` Jeff Garzik [this message]

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=4BEE00CB.6070900@garzik.org \
    --to=jeff@garzik.org \
    --cc=hail-devel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.