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

Re: [PATCH] t6026-merge-attr: wait for process to release trash directory

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 8, 2016, 08:05 UTC
Message-ID
<alpine.DEB.2.20.1609081002490.129229@virtualbox>
In-Reply-To
<20160907190004.dw3p6fxkdaubwuvu@sigill.intra.peff.net>
Hi Peff & Junio,
On Wed, 7 Sep 2016, Jeff King wrote:
Show 10 quoted lines
> On Wed, Sep 07, 2016 at 11:39:57AM -0700, Junio C Hamano wrote:
> 
> > > Can we do some signaling with fifos to tell the hook when it is safe to
> > > exit? Then we would just need to `wait` for its parent process.
> > 
> > Is fifo safe on Windows, though?
> 
> No clue. We seem to use mkfifo unconditionally in lib-daemon, but
> perhaps people do not run that test on Windows. Other invocations seem
> to be protected by the PIPE prerequisite. But...

AFAICT we do not use mkfifo on Windows. Let's see what t/test-lib.sh has to say about the matter:

	test_lazy_prereq PIPE '
		# test whether the filesystem supports FIFOs
		case $(uname -s) in
		CYGWIN*|MINGW*)
			false
			;;
		*)
			rm -f testfifo && mkfifo testfifo
			;;
		esac
	'
So there you go.

The reason it is disabled is that Cygwin/MSYS2 do have a concept of a FIFO. But `git.exe` won't be able to access such a FIFO because it is emulated by the POSIX emulation layer, which Git cannot access.

Show 7 quoted lines
> > With v2 that explicitly kills, I guess we can make the sleep longer
> > without slowing down in the optimistic case?
> 
> Yeah, I think the v2 one is non-racy (I thought at first we might race
> with the "echo", but it should be synchronous; the hook will not exit
> until we have written the pid file, and git will not exit until the hook
> is done running).

Please note that Hannes and I discussed this (as I originally suggested to increase it to 10 seconds, and Hannes rightfully pointed out that we would have to change the script name, too, as it says sleep-one-second.sh, and that would have made the patch less readable) and we came to the same conclusion: it's not necessary.

Ciao, Dscho

Previous: Junio C HamanoNext: Jeff King
Message 9 of 11 in “t6026-merge-attr: wait for process to release trash directory”
  1. t6026-merge-attr: wait for process to release trash directoryJohannes Sixt, Sep 5, 2016
  2. Johannes SchindelinSep 6, 2016
  3. t6026-merge-attr: clean up background process at end of test caseJohannes Sixt, Sep 7, 2016
  4. Johannes SchindelinSep 7, 2016
  5. Jeff KingSep 6, 2016
  6. Junio C HamanoSep 7, 2016
  7. Jeff KingSep 7, 2016
  8. Junio C HamanoSep 7, 2016
  9. Johannes SchindelinSep 8, 2016
  10. Jeff KingSep 8, 2016
  11. Johannes SchindelinSep 9, 2016

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.