git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Cc: Clemens Buchacher <drizzd@aon.at>,
	git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] t5570: forward git-daemon messages in a different way
Date: Mon, 16 Apr 2012 13:42:30 -0400	[thread overview]
Message-ID: <20120416174230.GA19226@sigill.intra.peff.net> (raw)
In-Reply-To: <4F8C3E0F.2040300@in.waw.pl>

On Mon, Apr 16, 2012 at 05:43:11PM +0200, Zbigniew Jędrzejewski-Szmek wrote:

> % 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.

Hmm. t5570 seems to pass reliably on dash for me with:

diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
index ef2d01f..9f52cb6 100644
--- a/t/lib-git-daemon.sh
+++ b/t/lib-git-daemon.sh
@@ -33,7 +33,7 @@ start_git_daemon() {
 	{
 		read line
 		echo >&4 "$line"
-		cat >&4 &
+		cat >&4 <git_daemon_output &
 
 		# Check expected output
 		if test x"$(expr "$line" : "\[[0-9]*\] \(.*\)")" != x"Ready to rumble"

But the test above does fail. Is it purely luck of the timing that
git-daemon never gets SIGPIPE? I guess the problem is that the
{}-section can finish before "cat <git_daemon_output" has actually
opened the pipe?

I'd just feel better about the solution if we were sure we understood
the exact problem.

-Peff

  parent reply	other threads:[~2012-04-16 17:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-14  8:44 [PATCH] t5570: forward git-daemon messages in a different way Zbigniew Jędrzejewski-Szmek
2012-04-14 12:13 ` Clemens Buchacher
2012-04-14 12:21   ` Clemens Buchacher
2012-04-16 15:43     ` Zbigniew Jędrzejewski-Szmek
2012-04-16 17:09       ` Junio C Hamano
2012-04-16 21:22         ` Clemens Buchacher
2012-04-16 22:06           ` Zbigniew Jędrzejewski-Szmek
2012-04-17 15:43             ` Junio C Hamano
2012-04-16 17:42       ` Jeff King [this message]
2012-04-16 22:44         ` Clemens Buchacher
2012-04-19  6:03           ` Jeff King
2012-04-19  6:58             ` Johannes Sixt
2012-04-26 13:01               ` Jeff King
2012-04-26 18:16                 ` Johannes Sixt
2012-04-26 19:55                   ` Clemens Buchacher
2012-04-26 21:00                     ` [PATCH] t5570: fix forwarding of git-daemon messages via cat Johannes Sixt
2012-04-26 21:10                       ` Zbigniew Jędrzejewski-Szmek
2012-04-27  7:59                       ` Jeff King
2012-04-27 15:02                       ` Junio C Hamano
2012-04-27  7:55                   ` [PATCH] t5570: forward git-daemon messages in a different way Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120416174230.GA19226@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=zbyszek@in.waw.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).