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

Re: [PATCH] t5570: forward git-daemon messages in a different way

From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
Apr 16, 2012, 15:43 UTC
Message-ID
<4F8C3E0F.2040300@in.waw.pl>
In-Reply-To
<20120414122127.GA31220@ecki>
On 04/14/2012 02:21 PM, Clemens Buchacher wrote:
Show 21 quoted lines
> On Sat, Apr 14, 2012 at 02:13:58PM +0200, Clemens Buchacher wrote:
>>
>> In order to better understand the problem on your side, can you execute
>> this script and tell me what it does for you?
> 
> Oops, this is what I really wanted:
> 
> #!/bin/sh
> 
> mkfifo fd
> yes>fd&
> pid=$!
> {
> 	read line
> 	echo $line
> 	cat<fd&
> }<fd
> sleep 1
> kill $pid
> wait $pid
> rm -f fd

Hi, many thanks for looking into this. I'm sorry I didn't reply sooner, but I was away for the weekend.

> And as a consequence, t5570 tests fail for you? I cannot reproduce with
> bash 4.2.24(2). Which git version are you seeing this with?
Yes. Example test output is:

----(on master 146fe8ce2)------------------------------------------------------------------ $ (cd t && GIT_TEST_GIT_DAEMON=t ./t5570*sh) ok 1 - setup repository ok 2 - create git-accessible bare repository not ok - 3 clone git repository # # git clone "$GIT_DAEMON_URL/repo.git" clone && # test_cmp file clone/file # not ok - 4 fetch changes via git protocol # # echo content >>file && # git commit -a -m two && # git push public && # (cd clone && git pull) && # test_cmp file clone/file # not ok 5 - remote detects correct HEAD # TODO known breakage ok 6 - prepare pack objects ok 7 - fetch notices corrupt pack ok 8 - fetch notices corrupt idx not ok - 9 clone non-existent # test_remote_error clone nowhere.git 'access denied or repository not exported' not ok - 10 push disabled # test_remote_error push repo.git 'access denied or repository not exported' not ok - 11 read access denied # test_remote_error -x fetch repo.git 'access denied or repository not exported' not ok - 12 not exported # test_remote_error -n fetch repo.git 'access denied or repository not exported' ./t5570-git-daemon.sh: 59: kill: No such process

error: git daemon exited with status: 141 -----------------------------------------------------------------------------------------

OK, I run your test scripts and found the problem (test.sh is the first version, and test2.sh is the second version with 'cat' inside {}). Yikes! I have /bin/sh symlinked to dash, and dash behaves differently:

% bash -x test2.sh | wc -l
+ mkfifo fd
+ pid=10685
+ yes
+ read line
+ echo y
+ sleep 1
+ cat
+ kill 10685
+ wait 10685
test2.sh: line 13: 10685 Terminated              yes > fd
+ rm -f fd
45400064
% dash -x test2.sh | wc -l
+ mkfifo fd
+ pid=10738
+ read line
+ yes
+ echo y
+ sleep 1
+ kill 10738
test2.sh: 12: kill: No such process
+ wait 10738
+ rm -f fd
^C

It hangs at the end until killed with ^C. This seem to happen fairly reliably (nineteen times out of twenty or so). This is with dash 0.5.7-3 and 0.5.5.1-7.4 from debian. With bash test2.sh seems to always run successfully.

I also run test.sh for comparison, and dash runs test.sh successfully every once in a while, and test.sh always fails with bash.

So my patch was totally bogus, it was just probably changing the timing.

Now your patches (on top of next): 'git-daemon wrapper to wait until daemon is ready' fixes the problem, thanks!

(I now see that they are both in pu: pu runs fine too.)

Thanks, Zbyszek

Previous: Clemens BuchacherNext: Junio C Hamano
Message 4 of 20 in “t5570: forward git-daemon messages in a different way”
  1. t5570: forward git-daemon messages in a different wayZbigniew Jędrzejewski-Szmek, Apr 14, 2012
  2. Clemens BuchacherApr 14, 2012
  3. Clemens BuchacherApr 14, 2012
  4. Zbigniew Jędrzejewski-SzmekApr 16, 2012
  5. Junio C HamanoApr 16, 2012
  6. Clemens BuchacherApr 16, 2012
  7. Zbigniew Jędrzejewski-SzmekApr 16, 2012
  8. Junio C HamanoApr 17, 2012
  9. Jeff KingApr 16, 2012
  10. Clemens BuchacherApr 16, 2012
  11. Jeff KingApr 19, 2012
  12. Johannes SixtApr 19, 2012
  13. Jeff KingApr 26, 2012
  14. Johannes SixtApr 26, 2012
  15. Clemens BuchacherApr 26, 2012
  16. t5570: fix forwarding of git-daemon messages via catJohannes Sixt, Apr 26, 2012
  17. Zbigniew Jędrzejewski-SzmekApr 26, 2012
  18. Jeff KingApr 27, 2012
  19. Junio C HamanoApr 27, 2012
  20. Jeff KingApr 27, 2012

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.