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

Re: [PATCH 2/3] git-daemon: make the signal handler almost a no-op

From
Stephen R. van den Berg <srb@cuci.nl>
Date
Aug 14, 2008, 10:13 UTC
Message-ID
<20080814101307.GG9680@cuci.nl>
In-Reply-To
<7vljz0dmtj.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
>"Stephen R. van den Berg" <srb@cuci.nl> writes:
>> Solution A is what you propose, but which I find less appealing because
>> any future magic to actually setup the handler needs to be maintained
>> and updated in two places.
>Well, A is attractive because it leaves the window open for us to later
>not rearming it unconditionally from child_handler().  I happen to think
>that the interface we will use to call "signal()" is much less likely to
>change than what we would do in child_handler().

Then that is the fundamental difference in maintainability-views. I find it more likely that we change the interface to setup the signal handler (in a future OS or by changing the way you invoke it), than that the actual work done by the signal handler is changed.

But since your view carries more weight here, I'll adapt the patch to solution A.

>> Solution C is what follows your train of thought better, because it
>> future-proofs the setup as well as the handler.
>"setup", but "setup" and "rearm" as separate functions.  Perhaps "setup"
>may start using sigaction() with SA_RESETHAND cleared, and we can make
>"rearm" truly a no-op everywhere.
>From a portability standpoint using sigaction is worse than signal, and
rearming the handler even when it is not required is not a big deal.
-- 
Sincerely,
           Stephen R. van den Berg.

"Hold still, while I inject you with SQL."
Previous: Junio C HamanoNext: Johannes Schindelin
Message 14 of 16 in “git-daemon: logging done right”
  1. 1/3 git-daemon: logging done rightStephen R. van den Berg, Aug 13, 2008
  2. 3/3 git-daemon: rewrite kindergardenStephen R. van den Berg, Aug 13, 2008
  3. Stephen R. van den BergAug 13, 2008
  4. git-daemon: rewrite kindergardenStephen R. van den Berg, Aug 13, 2008
  5. git-daemon: rewrite kindergarden, new option --max-connectionsStephen R. van den Berg, Aug 13, 2008
  6. Petr BaudisAug 13, 2008
  7. Stephen R. van den BergAug 13, 2008
  8. 2/3 git-daemon: make the signal handler almost a no-opStephen R. van den Berg, Aug 13, 2008
  9. Junio C HamanoAug 14, 2008
  10. Stephen R. van den BergAug 14, 2008
  11. Junio C HamanoAug 14, 2008
  12. Stephen R. van den BergAug 14, 2008
  13. Junio C HamanoAug 14, 2008
  14. Stephen R. van den BergAug 14, 2008
  15. Johannes SchindelinAug 14, 2008
  16. Junio C HamanoAug 13, 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.