git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Randall S. Becker" <rsbecker@nexbridge.com>
Cc: Max Kirillov <max@max630.net>,
	'Junio C Hamano' <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: [ANNOUNCE] Git v2.33.0-rc2 (Build/Test Report)
Date: Mon, 16 Aug 2021 17:59:05 -0400	[thread overview]
Message-ID: <YRrfqfzDibDegxin@coredump.intra.peff.net> (raw)
In-Reply-To: <YRretXfEfiVujSeO@coredump.intra.peff.net>

On Mon, Aug 16, 2021 at 05:55:01PM -0400, Jeff King wrote:

> So ideally we'd have some way of atomically checking our flag and then
> sleeping only if it's not set. But I don't think that exists. The
> closest we can come is using a series of smaller sleeps and checks. And
> indeed, digging in the archive shows that Max already proposed such a
> patch:
> 
>   https://lore.kernel.org/git/20190218205028.32486-1-max@max630.net/
> 
> It looks like it feel through the cracks, though. Maybe now is a good
> time to resurrect it.

And here it is for convenience. I think this is worth doing, as it
avoids occasional 60-second hangs in the test suite (and I confirmed
that with the "fail if it takes more than 5 seconds" hack I showed
earlier).

-- >8 --
From: Max Kirillov <max@max630.net>
Subject: [PATCH] t5562: chunked sleep to avoid lost SIGCHILD

If was found during stress-test run that a test may hang by 60 seconds.
It supposedly happens because SIGCHILD was received before sleep has
started.

Fix by looping by smaller chunks, checking $exited after each of them.
Then lost SIGCHILD would not cause longer delay than 1 second.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5562/invoke-with-content-length.pl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/t/t5562/invoke-with-content-length.pl b/t/t5562/invoke-with-content-length.pl
index 0943474af2..257e280e3b 100644
--- a/t/t5562/invoke-with-content-length.pl
+++ b/t/t5562/invoke-with-content-length.pl
@@ -29,7 +29,12 @@
 }
 print $out $body_data or die "Cannot write data: $!";
 
-sleep 60; # is interrupted by SIGCHLD
+my $counter = 0;
+while (not $exited and $counter < 60) {
+        sleep 1;
+        $counter = $counter + 1;
+}
+
 if (!$exited) {
         close($out);
         die "Command did not exit after reading whole body";
-- 
2.33.0.rc2.497.g375df73092


  reply	other threads:[~2021-08-16 21:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13 14:22 [ANNOUNCE] Git v2.33.0-rc2 (Build/Test Report) Randall S. Becker
2021-08-13 15:00 ` Junio C Hamano
2021-08-13 16:06 ` Jeff King
2021-08-16 18:08   ` Randall S. Becker
2021-08-16 18:35     ` Jeff King
2021-08-16 18:54       ` Randall S. Becker
2021-08-16 21:55         ` Jeff King
2021-08-16 21:59           ` Jeff King [this message]
2021-08-16 18:31   ` Randall S. Becker
2021-08-16 18:36     ` Jeff King
2021-08-16 20:43       ` Randall S. Becker
2021-08-16 21:02         ` Jeff King
2021-08-16 21:54           ` Randall S. Becker
2021-08-16 22:22             ` Jeff King
2021-08-16 22:29               ` Jeff King
2021-08-17 14:30                 ` Randall S. Becker
2021-08-17 14:29               ` Randall S. Becker

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=YRrfqfzDibDegxin@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=max@max630.net \
    --cc=rsbecker@nexbridge.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).