Skip to content

h2/h3, things around POST, slow network simulation - #11756

Closed
icing wants to merge 11 commits into
curl:masterfrom
icing:h2-post-tests
Closed

icing wants to merge 11 commits into
curl:masterfrom
icing:h2-post-tests

Conversation

@icing

@icing icing commented Aug 29, 2023 •

Copy link
Copy Markdown
Contributor
  • added test cases for various code paths
  • fixed handling of blocked write when stream had been closed inbetween attempts
  • re-enabled DEBUGASSERT on send with smaller data size

slow network simulation, fixes

  • in debug builds, environment variables can be set to simulate a slow
    network when sending data. cf-socket.c and vquic.c support

    • CURL_DBG_SOCK_WBLOCK: percentage of send() calls that should be
      answered with a EAGAIN. TCP/UNIX sockets.
      This is chosen randomly.
    • CURL_DBG_SOCK_WPARTIAL: percentage of data that shall be written
      to the network. TCP/UNIX sockets.
      Example: 80 means a send with 1000 bytes would only send 800
      This is applied to every send.
    • CURL_DBG_QUIC_WBLOCK: percentage of send() calls that should be
      answered with EAGAIN. QUIC only.
      This is chosen randomly.
  • Fixes in http2.c and cf-h2-proxy.c to make test cases pass

  • tests: some tests are skipped when the env vars are set, because
    they would time out just because of the amount of requests/data

  • multi.c: on debug, print the state a transfer was in when it
    switched to done, e.g. was ended/aborted.

@jay

jay commented Aug 30, 2023

Copy link
Copy Markdown
Member

Is this related to #11342 (review)

@bagder

bagder commented Aug 30, 2023

Copy link
Copy Markdown
Member

I believe it is work to polish code, which ideally makes the people in #11342 who still experience problems happy.

It brings back the assert that was removed because of #11500, so OSS-fuzz can help us verify this.

@icing

icing commented Aug 30, 2023

Copy link
Copy Markdown
Contributor Author

Is this related to #11342 (review)

This is part of the hunt for this issue, unsuccessful so far, but discovering other edge paths.

@icing icing changed the title h2, things around POST h2/h3, things around POST Aug 30, 2023
@icing icing changed the title h2/h3, things around POST h2/h3, things around POST, slow network simulation Aug 31, 2023
@github-actions github-actions Bot added the CI Continuous Integration label Sep 1, 2023
icing added 11 commits September 4, 2023 07:37
- added test cases for various code paths
- fixed handling of blocked write when stream had
  been closed inbetween attempts
- re-enabled DEBUGASSERT on send with smaller data size
…tely sent and acked.

- transfer loop: treat keepon SEND without RECV the same when the
  connection is marked for close as for stream based transfers
- ngtcp2|quiche: clear HOLD flag on transfer when stream is closed
- ngtcp2|quiche: skip DATA_IDLE handling for transfers without
  an open stream
- servers may send a response without reading the full request
  body, e.g. when sending 30x or 40x responses
- transfer loop might be sending when the stream switches to
  closed. Failing the send then leads to transfer failure
  which is not appropriate as the response is no longer evaluated
  then.
- add code to silently discard request body data in such cases
- in debug builds, environment variables can be set to simulate a slow
  network when sending data. cf-socket.c and vquic.c support
  * CURL_DBG_SOCK_WBLOCK: percentage of send() calls that should be
    answered with a EAGAIN. TCP/UNIX sockets.
    This is chosen randomly.
  * CURL_DBG_SOCK_WPARTIAL: percentage of data that shall be written
    to the network. TCP/UNIX sockets.
    Example: 80 means a send with 1000 bytes would only send 800
    This is applied to every send.
  * CURL_DBG_QUIC_WBLOCK: percentage of send() calls that should be
    answered with EAGAIN. QUIC only.
    This is chosen randomly.

- Fixes in http2.c and cf-h2-proxy.c to make test cases pass
- tests: some tests are skipped when the env vars are set, because
  they would time out just because of the amount of requests/data
- multi.c: on debug, print the state a transfer was in when it
  switched to done, e.g. was ended/aborted.
- http2 RST FRAME traces now also the error code
- http2 RST with error 0 does NOT indicate a failed transfer
@icing
icing requested a review from bagder September 4, 2023 07:19
@bagder bagder closed this in 331b89a Sep 4, 2023
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
- added test cases for various code paths
- fixed handling of blocked write when stream had
  been closed inbetween attempts
- re-enabled DEBUGASSERT on send with smaller data size

- in debug builds, environment variables can be set to simulate a slow
  network when sending data. cf-socket.c and vquic.c support
  * CURL_DBG_SOCK_WBLOCK: percentage of send() calls that should be
    answered with a EAGAIN. TCP/UNIX sockets.
    This is chosen randomly.
  * CURL_DBG_SOCK_WPARTIAL: percentage of data that shall be written
    to the network. TCP/UNIX sockets.
    Example: 80 means a send with 1000 bytes would only send 800
    This is applied to every send.
  * CURL_DBG_QUIC_WBLOCK: percentage of send() calls that should be
    answered with EAGAIN. QUIC only.
    This is chosen randomly.

Closes curl#11756
gitster pushed a commit to git/git that referenced this pull request Sep 23, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
exclude the flaky t5559.15 and its dependent t5559.16 on Debian 12 until
the packaged curl carries the fix (or until the end of time, whichever
comes first).

Assisted-by: GPT-6 Astra
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Sep 24, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

Assisted-by: GPT-6 Astra, GPT-6 Sol
Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Sep 24, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
gitster pushed a commit to git/git that referenced this pull request Sep 24, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
ttaylorr-oai pushed a commit to openai/git that referenced this pull request Sep 26, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Oct 25, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

Backported from 64172cf (ci: work around Debian 12's HTTP/2
authentication failures, 2026-09-24) with e2d64bd (t5551: fix
quoting in curl version bug prereq, 2026-10-05) squashed in.

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
JustYannicc pushed a commit to JustYannicc/git that referenced this pull request Nov 10, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

Backported from 64172cf (ci: work around Debian 12's HTTP/2
authentication failures, 2026-09-24).

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
ttaylorr-oai pushed a commit to openai/git that referenced this pull request Nov 18, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

[tb: Quote the awk field references so shell test arguments cannot
replace them, and guard the gzip authentication retry regression too.]

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
(cherry picked from commit c536fa7)
ttaylorr-oai pushed a commit to openai/git that referenced this pull request Nov 18, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

[tb: Quote the awk field references so shell test arguments cannot
replace them, and guard the gzip authentication retry regression too.]

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
(cherry picked from commit c536fa7)
ttaylorr-oai pushed a commit to openai/git that referenced this pull request Dec 2, 2026
Since 00fa850 (ci: bump debian-11 job to debian-12, 2026-09-05), the
`debian-12` job has intermittently failed t5559's half-auth clone with:

  curl 92 Stream error in the HTTP/2 framing layer

Anonymous discovery succeeds, but the upload-pack POST requires
authentication. Apache can return an early 401 and close the HTTP/2
stream before libcurl finishes sending the request body. Debian 12's
curl 7.88.1 treats that closure as a transport error instead of allowing
an authentication retry. Curl fixed this handling in 331b89a319d0
(http2: polish things around POST), included in 8.3.0:
curl/curl#11756

This did not happen before switching to Debian 12 because Debian 11
ships with libcurl 7.74.0-1.3+deb11u16, which does not have that bug, it
was only introduced in cURL 7.88.0.

Replacing the packaged libcurl with a modern build would defeat this
job's purpose of testing older supported distributions. So let's simply
skip the flaky test cases when a buggy libcurl version is detected.

[tb: Quote the awk field references so shell test arguments cannot
replace them, and guard the gzip authentication retry regression too.]

Assisted-by: GPT-6 Astra, GPT-6 Sol
Helped-by: Jeff King <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
(cherry picked from commit c536fa7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration HTTP/2 tests

Development

Successfully merging this pull request may close these issues.

3 participants