[PATCH 3/3] daemon.c: make sure kill_some_child() really kills somebody

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 * 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux