Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 11 commits into from

Conversation

icing
Copy link
Contributor

@icing icing commented Aug 29, 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

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
Copy link
Member

jay commented Aug 30, 2023

Is this related to #11342 (review)

@bagder
Copy link
Member

bagder commented Aug 30, 2023

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
Copy link
Contributor Author

icing commented Aug 30, 2023

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
- 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
@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
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.

None yet

3 participants