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

Re: [PATCH] Fix race and deadlock when sending pack

From
Junio C Hamano <junkio@cox.net>
Date
Dec 19, 2005, 22:44 UTC
Message-ID
<7vr788emfr.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0512191645230.25300@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> If we have the reporting mechanism, that will effectively be part of the 
> protocol. It's obviously done transferring the pack at that point, but it 
> still wants fixed-format communication, so switching over to being the 
> stardard output of the hooks would cause problems with this.

In order to add reporting mechanism later, I think we need to be able to identify the protocol version in a backward compatible way, something like the "server capabilities hidden behind the NUL" trick we did for fetch-pack/upload-pack protocol. Once that is in place, it does not cause harm even if the current protocol program connects hooks' stdout to send-pack, at least in theory. If we take Paul's patch now, however, it would add more work for us later when we do that protocol change, because we will need to wrap the output from the hook in the pkt-line interface in the new protocol, in order to give that back to the stdout of send-pack. Considering that, I think we may want to drop Paul's patch and declare that hooks stdout does not come back to send-pack.

Honestly speaking, I do not really care where stdout of hooks go as long as that does not cause breakage/deadlocks, and I think your earlier patch on December 7th is serving us well enough; we needed to have told users to do an "exec 1>somewhere" in their hooks before that fix, which was not nice at all (and we even forgot to tell them that). If people want to send the output to a log file, they can do so; if they want e-mails, they can do so; if they want to show the output to the pusher, they can do 1>&2; all inside their hooks. I do "echo nitfol | at now" and love the way that I do not have to worry about how "at" command gives me back execution report via e-mail at all ;-).

> It's probably worth making sure that all the hooks run with something 
> sane, and punt making it configurable andnice until post-1.0.

I think we agree that /dev/null is one of the sane choices as you did in your earlier fix. Duping stderr would have been another sane choice, but I honestly do not think we care much either way.

Previous: Daniel BarkalowNext: Daniel Barkalow
Message 7 of 10 in “Fix race and deadlock when sending pack”
  1. Fix race and deadlock when sending packPaul Serice, Dec 19, 2005
  2. Junio C HamanoDec 19, 2005
  3. Paul SericeDec 19, 2005
  4. Daniel BarkalowDec 19, 2005
  5. Junio C HamanoDec 19, 2005
  6. Daniel BarkalowDec 19, 2005
  7. Junio C HamanoDec 19, 2005
  8. Daniel BarkalowDec 19, 2005
  9. Junio C HamanoDec 19, 2005
  10. Paul SericeDec 19, 2005

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.