Re: [PATCH v19 03/10] receive-pack: add new proc-receive hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Me again,

On Wed, 4 Nov 2020, Johannes Schindelin wrote:

> On Thu, 27 Aug 2020, Jiang Xin wrote:
>
> > +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@xxxxxxxxxx/ seemed to
> help this issue at first, but then turned out not to prevent the same
> issue from happening again.
>
> Any ideas?

More puzzles. I was finally able to reproduce the hang in a `--stress`
run. It basically happens in t5411.186, which is stalled at this:

-- snip --
[...]
expecting success of 5411.186 'proc-receive: bad protocol (hook --die-readline, HTTP 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

+++ 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
-- snap --

That `push` never goes anywhere. And I found something of a clue at
`trash directory.t5411-proc-receive-hook.stress-*/httpd/error.log`:

-- snip --
[...]
[Wed Nov 04 22:28:20.838388 2020] [cgi:error] [pid 60577] [client 127.0.0.1:52794] AH01215: fatal: unable to write flush packet: Broken pipe: /Users/runner/work/git/git/git-http-backend
-- snap --

This is once again running _with_ Gábor's patch mentioned in the quoted
part above.

Could you please look into this?

Ciao,
Johannes

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux