git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] git daemon: avoid calling syslog() from a signal handler

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2008, 01:50 UTC
Message-ID
<7vmykua2et.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LSU.1.00.0807061414320.3486@wbgn129.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 9 quoted lines
> 	Note that we still have to check for dead children in 
> 	check_max_connections(), and since child_handler() knows nothing 
> 	about that, it still will write to the pipe, waking up the loop 
> 	unnecessarily.
>
> 	But that will be rare.
>
> 	This is no longer as trivial as I wanted it to be, so I'd 
> 	appreciate a few eyeballs on this patch.

Yeah, I think the fix-up I sent on top of your patch to make 1-sec timeout conditional would be more appropriate for 'maint' than this one, even though it is a band-aid to the issue.

Another thing we might want to consider to make this logic much more simpler would be to move everything out of child_handler(), except the write() whose sole purpose is to allow us break out of the poll().

Then you do not have to use "negative is error and positive is success" convention (which you may regret later when you would need to pass more than one bit of information from the callsite of waitpid() to the callsite of syslog()), nor separate "reap here, report there" code structure.

Previous: Johannes SchindelinNext: Stephen R. van den Berg
Message 12 of 13 in “Non-inetd git-daemon hangs in syslog(3)/fclose(3) if --syslog --verbose accessing non-repositories”
  1. Brian FosterJul 3, 2008
  2. Johannes SchindelinJul 3, 2008
  3. Brian FosterJul 3, 2008
  4. Johannes SchindelinJul 3, 2008
  5. git daemon: avoid calling syslog() from a signal handlerJohannes Schindelin, Jul 3, 2008
  6. Junio C HamanoJul 5, 2008
  7. Johannes SchindelinJul 5, 2008
  8. Junio C HamanoJul 5, 2008
  9. Johannes SchindelinJul 6, 2008
  10. Junio C HamanoJul 6, 2008
  11. git daemon: avoid calling syslog() from a signal handlerJohannes Schindelin, Jul 6, 2008
  12. Junio C HamanoJul 7, 2008
  13. Stephen R. van den BergJul 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.