Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH] daemon.c: squelch error message from EINTR
Date: Tue, 02 Aug 2005 23:20:01 -0700	[thread overview]
Message-ID: <7voe8fk0dq.fsf@assigned-by-dhcp.cox.net> (raw)

This is a "call for help" patch.  The kernel.org folks are
talking about installing git daemon, and while the problem I am
trying to address should not matter when the daemon is spawned
from inetd, I would like to get this resolved.  Help greatly
apprciated.

-jc

------------
It appears that every time after servicing the connection,
select() first fails with EINTR and ends up waiting for one
second before serving the next client.  The sleep() was placed
by the original author per suggestion from the list to avoid
spinning on failing select, but at least this EINTR situation
should not result in "at most one client per second" service
limit.

I am not sure if this is the right fix, and I have not received
an answer from the original author of the patch.  I would
appreciate help from the folks on the list who are familiar with
the networking.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 daemon.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

34be43e7af874923cfa1c8baeaf19fa17bae4d30
diff --git a/daemon.c b/daemon.c
--- a/daemon.c
+++ b/daemon.c
@@ -294,8 +294,11 @@ static int serve(int port)
 		fds = fds_init;
 		
 		if (select(maxfd + 1, &fds, NULL, NULL, NULL) < 0) {
-			error("select failed, resuming: %s", strerror(errno));
-			sleep(1);
+			if (errno != EINTR) {
+				error("select failed, resuming: %s",
+				      strerror(errno));
+				sleep(1);
+			}
 			continue;
 		}
 

             reply	other threads:[~2005-08-03  6:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-03  6:20 Junio C Hamano [this message]
2005-08-04 20:29 ` [PATCH] daemon.c: squelch error message from EINTR Petr Baudis

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=7voe8fk0dq.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox