Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Ted Nyman <tnyman@openai.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, me@ttaylorr.com, ps@pks.im,
	karthik.188@gmail.com, sandals@crustytoothpaste.net,
	avarab@gmail.com
Subject: Re: [PATCH v3 0/3] packfile URIs: support concurrent downloads
Date: Sat, 25 Jul 2026 06:10:43 -0400	[thread overview]
Message-ID: <20260725101043.GA2171844@coredump.intra.peff.net> (raw)
In-Reply-To: <20260725100251.GA1933232@coredump.intra.peff.net>

On Sat, Jul 25, 2026 at 06:02:51AM -0400, Jeff King wrote:

> I wonder if we could just drop that "test -s" entirely. We'd _usually_
> see some bytes written before the second request starts. But it's OK if
> we don't. It just means the test is working in the reverse order (the
> second request may write its bytes first, and then the first one is the
> one "overwriting" it). I.e., the two are symmetric from our perspective.

Yeah, doing this:

diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index dcb9667eeb..07aa218049 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -516,7 +516,6 @@ test_expect_success PERL,PIPE 'concurrent http-fetch --packfile cannot corrupt a
 	read ready <&8 &&
 	test "$ready" = ready &&
 	test_path_is_file "$tmpfile" &&
-	test -s "$tmpfile" &&
 	{
 		GIT_TRACE_CURL="$TRASH_DIRECTORY/overlap-second.trace" \
 		GIT_TRACE_CURL_NO_DATA=1 \
@@ -533,9 +532,6 @@ test_expect_success PERL,PIPE 'concurrent http-fetch --packfile cannot corrupt a
 	wait "$second_pid" &&
 	wait "$first_pid" &&
 	wait "$server_pid" &&
-	test_grep "HTTP/[0-9.]* 200" overlap-first.trace &&
-	test_grep "Range: bytes=[1-9][0-9]*-" overlap-second.trace &&
-	test_grep "HTTP/[0-9.]* 206" overlap-second.trace &&
 	printf "keep\t%s\npack\t%s\n" "$packhash" "$packhash" | sort >expect &&
 	sort first.out second.out >actual &&
 	test_cmp expect actual &&

is enough to make it pass reliably under --stress for me. We have to
drop the trace greps, because we don't actually know whether each
request will use a range or not. We'd _usually_ see a range for the
second one, but it's possible it might still see a zero-byte file. I
guess we probably see a "200" reliably for the first request, but it's
not all that interesting.

We can leave the test_path_is_file check, because we open the file
before making the request (it is only the actual writing of bytes that
is racy).

-Peff

  reply	other threads:[~2026-07-25 10:10 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 22:37 [PATCH 0/2] packfile URIs: support concurrent downloads Ted Nyman
2026-07-13 22:34 ` [PATCH 1/2] http: use unique tempfiles for packfile URI downloads Ted Nyman
2026-07-14  1:00   ` Junio C Hamano
2026-07-14  1:58     ` Ted Nyman
2026-07-14  4:07       ` Taylor Blau
2026-07-14  5:28       ` Jeff King
2026-07-14 18:10         ` Junio C Hamano
2026-07-14 18:31           ` Ted Nyman
2026-07-14  4:06   ` Taylor Blau
2026-07-14  5:44     ` Jeff King
2026-07-14  6:46   ` Jeff King
2026-07-13 22:34 ` [PATCH 2/2] fetch-pack: accept "pack" output for packfile URIs Ted Nyman
2026-07-14  7:12   ` Jeff King
2026-07-14  7:13     ` Jeff King
2026-07-14 18:38     ` Ted Nyman
2026-07-14 21:47       ` Jeff King
2026-07-14  4:13 ` [PATCH 0/2] packfile URIs: support concurrent downloads Taylor Blau
2026-07-20 22:33 ` [PATCH v2 " Ted Nyman
2026-07-20 22:33   ` [PATCH v2 1/2] http: avoid concurrent appends to partial packs Ted Nyman
2026-07-21 19:56     ` Junio C Hamano
2026-07-20 22:34   ` [PATCH v2 2/2] fetch-pack: accept "pack" output for packfile URIs Ted Nyman
2026-07-21 23:29 ` [PATCH v3 0/3] packfile URIs: support concurrent downloads Ted Nyman
2026-07-21 23:29   ` [PATCH v3 1/3] http-fetch: correct --index-pack-arg documentation Ted Nyman
2026-07-21 23:29   ` [PATCH v3 2/3] http: avoid concurrent appends to partial packs Ted Nyman
2026-07-21 23:29   ` [PATCH v3 3/3] fetch-pack: accept "pack" output for packfile URIs Ted Nyman
2026-07-24  4:43   ` [PATCH v3 0/3] packfile URIs: support concurrent downloads Junio C Hamano
2026-07-25  9:09     ` Jeff King
2026-07-25  9:21       ` Jeff King
2026-07-25 10:02         ` Jeff King
2026-07-25 10:10           ` Jeff King [this message]
2026-07-25 16:20           ` Junio C Hamano
2026-07-24  8:14   ` [PATCH v4 " Ted Nyman
2026-07-24  8:14     ` [PATCH v4 1/3] http-fetch: correct --index-pack-arg documentation Ted Nyman
2026-07-24 21:38       ` Taylor Blau
2026-07-24  8:14     ` [PATCH v4 2/3] http: avoid concurrent appends to partial packs Ted Nyman
2026-07-24  8:14     ` [PATCH v4 3/3] fetch-pack: accept "pack" output for packfile URIs Ted Nyman
2026-07-24 21:46       ` Taylor Blau
2026-07-26  6:44     ` [PATCH v5 0/3] packfile URIs: support concurrent downloads Ted Nyman
2026-07-26  6:44       ` [PATCH v5 1/3] http-fetch: correct --index-pack-arg documentation Ted Nyman
2026-07-26  6:44       ` [PATCH v5 2/3] http: avoid concurrent appends to partial packs Ted Nyman
2026-07-26  9:20         ` Jeff King
2026-07-26 10:04           ` Ted Nyman
2026-07-26 10:27             ` Jeff King
2026-07-26  6:44       ` [PATCH v5 3/3] fetch-pack: accept "pack" output for packfile URIs Ted Nyman
2026-07-26  9:21       ` [PATCH v5 0/3] packfile URIs: support concurrent downloads 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=20260725101043.GA2171844@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=ps@pks.im \
    --cc=sandals@crustytoothpaste.net \
    --cc=tnyman@openai.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox