From: Patrick Steinhardt <ps@pks.im>
To: Wei Hu <weihu.math@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: receive-pack hangs on zero-object push into promisor-shaped repository
Date: Mon, 29 Jun 2026 17:30:22 +0200 [thread overview]
Message-ID: <akKPjjfabiRkTbtt@pks.im> (raw)
In-Reply-To: <CACLXMtCSzW9BY7idqB1yGa87MeG0Y2FN5Ho2hRXuPJ_qswE27Q@mail.gmail.com>
On Mon, Jun 29, 2026 at 03:10:42PM +0800, Wei Hu wrote:
> Hello,
>
> I found a reproducible hang in `git receive-pack` when pushing a ref update
> that sends zero objects into a repository that has promisor remote
> configuration and `.promisor` pack sidecar files.
>
> The same zero-object ref update returns normally when the receiving
> repository is a normal non-bare repository or a bare repository. It
> also returns normally if I remove either the promisor remote config or
> the `.promisor` sidecar files from the receiving repository.
>
> Check the attached script to reproduce the bug.
Thanks for your report! I was able to reduce your test case to the
following minimal reproducer:
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index 1c2805acca..2850e78e49 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -723,6 +723,28 @@ test_expect_success 'after fetching descendants of non-promisor commits, gc work
git -C partial gc --prune=now
'
+test_expect_success 'zero-object push does not hang' '
+ rm -rf src dst &&
+
+ git init src &&
+ test_commit -C src initial &&
+
+ git init --bare dst &&
+ git -C src push "$(pwd)/dst" main &&
+ git -C dst config set remote.origin.promisor true &&
+ git -C dst maintenance run &&
+ for pack in dst/objects/pack/*.pack
+ do
+ >"${pack%.pack}.promisor" || return 1
+ done &&
+
+ # Push the already-existing commit with a new branch name, which
+ # results in zero objects being written. This used to hang in the past.
+ git -C src push "$(pwd)/dst" main:topic &&
+ git -C src rev-parse main >expect &&
+ git -C dst rev-parse topic >actual &&
+ test_cmp expect actual
+'
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd
As it turns out, the bug itself was fixed already via d9982e8290
(connected: close err_fd in promisor fast-path, 2026-05-15), and that
fix is going to be part of Git 2.55 (which is due today).
That commit didn't add a test for this scenario though, even though the
commit message points out that there's been multiple regressions in this
area already. It's probably worth it to add the above test to our test
suite. Is this something you'd like to do? Otherwise I'm happy to send a
patch.
Thanks!
Patrick
prev parent reply other threads:[~2026-06-29 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 7:10 receive-pack hangs on zero-object push into promisor-shaped repository Wei Hu
2026-06-29 15:30 ` Patrick Steinhardt [this message]
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=akKPjjfabiRkTbtt@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=weihu.math@gmail.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