Re: [msysGit] [PATCH/RFC 06/11] run-command: add kill_async() and is_async_alive()

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

 



On Freitag, 27. November 2009, Erik Faye-Lund wrote:
> Do you really think it's better to unconditionally take down the
> entire process with an error, instead of having a relatively small
> chance of stuff blowing up without any sensible error? I'm not 100%
> convinced - but let's hope we'll find a proper fix.

"relatively small chance of stuff blowing up"? The docs of 
TerminateThread: "... the kernel32 state for the thread's process could be 
inconsistent." That's scary if we are talking about a process that should run 
for days or weeks without interruption.

The reason why we are killing a thread is to prevent keeping lots of 
connections open (to the same IP address). There are two situations to take 
care of:

1. We are in a lengthy computation without paying attention to the socket.

2. The client does not send or accept data for a long time.

Case 1 could happen if upload-pack is "counting objects" on a large 
repository. We would need some way to kill upload-pack. Since it is a 
separate process anyway, we could use TerminateProcess().

Case 2 could be achieved by using setsockopt() with SO_RCVTIMEO and 
SO_SNDTIMEO and a tiny timeout. But notice that we would set a timeout in one 
thread while another thread is waiting in ReadFile() or WriteFile(). Would 
that work?

-- Hannes
--
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]