Re: [PATCH v19 03/10] receive-pack: add new proc-receive hook
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 4, 2020, 22:15 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2011042236270.18437@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20200827154551.5966-4-worldhello.net@gmail.com>
Hi,
On Thu, 27 Aug 2020, Jiang Xin wrote:
Show 25 quoted lines
> +test_expect_success "setup proc-receive hook (hook --die-readline, $PROTOCOL)" ' > + write_script "$upstream/hooks/proc-receive" <<-EOF > + printf >&2 "# proc-receive hook\n" > + test-tool proc-receive -v --die-readline > + EOF > +' > + > +# Refs of upstream : master(A) > +# Refs of workbench: master(A) tags/v123 > +# git push : refs/for/master/topic(A) > +test_expect_success "proc-receive: bad protocol (hook --die-readline, $PROTOCOL)" ' > + test_must_fail git -C workbench push origin \ > + HEAD:refs/for/master/topic \ > + >out 2>&1 && > + make_user_friendly_and_stable_output <out >actual && > + > + grep "remote: fatal: protocol error: expected \"old new ref\", got \"<ZERO-OID> <COMMIT-A> refs/for/master/topic\"" actual && > + > + git -C "$upstream" show-ref >out && > + make_user_friendly_and_stable_output <out >actual && > + cat >expect <<-EOF && > + <COMMIT-A> refs/heads/master > + EOF > + test_cmp expect actual > +'
While investigating a flaky hang in t5411 in the osx-clang job of our CI/PR builds, I ran into this issue (with --stress):
-- snip -- [...] +++ test_must_fail git -C workbench push origin HEAD:refs/for/main/topic +++ case "$1" in +++ _test_ok= +++ test_must_fail_acceptable git -C workbench push origin HEAD:refs/for/main/topic +++ test git = env +++ case "$1" in +++ return 0 +++ git -C workbench push origin HEAD:refs/for/main/topic +++ exit_code=128 +++ test 128 -eq 0 +++ test_match_signal 13 128 +++ test 128 = 141 +++ test 128 = 269 +++ return 1 +++ test 128 -gt 129 +++ test 128 -eq 127 +++ test 128 -eq 126 +++ return 0 +++ make_user_friendly_and_stable_output ++++ echo 4844d8acf2fc62b151a29cfb3b916b6778476b9e ++++ cut -c1-7 ++++ echo c208c3bb8a1aeea6d4e40027a17251ccd59a2b1b ++++ cut -c1-7 +++ sed -e 's/ *$//' -e 's/ */ /g' -e 's/'\''/"/g' -e 's/ / /g' -e 's/4844d8acf2fc62b151a29cfb3b916b6778476b9e/<COMMIT-A>/g' -e 's/c208c3bb8a1aeea6d4e40027a17251ccd59a2b1b/<COMMIT-B>/g' -e 's/f7cc02ec1b3393b9a9638a0e02a7039c234cffa4/<TAG-v123>/g' -e 's/0000000000000000000000000000000000000000/<ZERO-OID>/g' -e 's/4844d8a[0-9a-f]*/<OID-A>/g' -e 's/c208c3b[0-9a-f]*/<OID-B>/g' -e 's#To \.\./upstream.git#To <URL/of/upstream.git>#' -e '/^error: / d' +++ grep 'remote: fatal: protocol error: expected "old new ref", got "<ZERO-OID> <COMMIT-A> refs/for/main/topic"' actual error: last command exited with $?=1 not ok 34 - proc-receive: bad protocol (hook --die-readline, builtin protocol) # # test_must_fail git -C workbench push origin \ # HEAD:refs/for/main/topic \ # >out 2>&1 && # make_user_friendly_and_stable_output <out >actual && # # grep "remote: fatal: protocol error: expected \"old new # ref\", got \"<ZERO-OID> <COMMIT-A> refs/for/main/topic\"" # actual && # # git -C "$upstream" show-ref >out && # make_user_friendly_and_stable_output <out >actual && # cat >expect <<-EOF && # <COMMIT-A> refs/heads/main # EOF # test_cmp expect actual # -- snap --
The output of `actual` reads like this:
-- snip -- remote: # pre-receive hook remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic remote: # proc-receive hook fatal: unable to write flush packet: Broken pipe send-pack: unexpected disconnect while reading sideband packet fatal: the remote end hung up unexpectedly -- snap --
Applying Gábor's patch as obtained from https://lore.kernel.org/git/20190830121005.GI8571@szeder.dev/ seemed to help this issue at first, but then turned out not to prevent the same issue from happening again.
Any ideas?
Ciao, Johannes