git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Stephen R. van den Berg" <srb@cuci.nl>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH 3/3] daemon.c: make sure kill_some_child() really kills somebody
Date: Sun, 24 Aug 2008 13:33:11 -0700	[thread overview]
Message-ID: <7vk5e6kvaw.fsf_-_@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vwsi6kvow.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 24 Aug 2008 13:24:47 -0700")

We used to kill nobody if there is no existing connection from the same
address the new connection we are trying to handle, and dropped the new
connection.  Make sure we at least kill one.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * I am not sure about this one, but it may be more in spirit with the old
   behaviour that made sure at max connection limit we killed some to
   handle new ones.

   Actually I do think this is probably a bad idea.  What we really want
   to do is to detect an old one that is not making any progress instead.
   "old" we can detect by looking at its position in the queue (or we
   could even add an explicit timestamp to the child structure), but it is
   harder to measure "not making any progress", especially without going
   too platform specific, e.g. monitoring rusage or somesuch, which we
   would want to avoid.

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

diff --git a/daemon.c b/daemon.c
index 8d2755a..a0d8f65 100644
--- a/daemon.c
+++ b/daemon.c
@@ -641,8 +641,11 @@ static void kill_some_child(void)
 		if (!memcmp(&blanket->address, &next->address,
 			    sizeof(next->address))) {
 			kill(blanket->pid, SIGTERM);
-			break;
+			return;
 		}
+
+	/* Nobody from the same address?  Kill the youngest one, then. */
+	kill(firstborn->pid, SIGTERM);
 }
 
 static void check_dead_children(void)
-- 
1.6.0.129.ge10d2

  parent reply	other threads:[~2008-08-24 20:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-24  3:38 What's cooking in git.git (Aug 2008, #07; Sat, 23) Junio C Hamano
2008-08-24  4:00 ` Maintaining "needswork" section of "What's (not) cooking" Junio C Hamano
2008-08-24 18:12 ` What's cooking in git.git (Aug 2008, #07; Sat, 23) Johannes Schindelin
2008-08-24 19:16   ` Junio C Hamano
2008-08-24 20:24     ` Junio C Hamano
2008-08-24 20:27       ` [PATCH 1/3] daemon.c: minor style fixup Junio C Hamano
2008-08-24 20:27       ` [PATCH 2/3] daemon.c: simplify add_child() and kill_some_child() logic Junio C Hamano
2008-08-24 20:33       ` Junio C Hamano [this message]
2008-08-25 16:32       ` What's cooking in git.git (Aug 2008, #07; Sat, 23) Stephen R. van den Berg
2008-08-25 20:19         ` Junio C Hamano
2008-08-25 21:27           ` Stephen R. van den Berg

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vk5e6kvaw.fsf_-_@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=srb@cuci.nl \
    /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://80x24.org/mirrors/git.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).