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

http3: ignore context after response when using DontCloseRequestStream #3473

Merged
merged 1 commit into from
Jul 24, 2022

Conversation

marten-seemann
Copy link
Member

In WebTransport, the request stream is kept alive for the lifetime of the WebTransport session (and used to communicate shutdown of that session).

This leads to problems when using a ctx in Roundtrip. The following code should be valid, using ctx to control cancelation of the WebTransport handshake:

ctx, cancel := context.WithCancel(context.Background())
req = req.WithContext(ctx)
rsp, _ := rountripper.RoundTrip(req)
cancel()

However, it also resets the request stream (and thereby closes the WebTransport session) as soon as the WebTransport handshake completes.

@marten-seemann marten-seemann force-pushed the fix-request-stream-cancelation-dont-close branch from 30401e2 to 418532e Compare July 10, 2022 16:56
@codecov
Copy link

codecov bot commented Jul 10, 2022

Codecov Report

Merging #3473 (418532e) into master (f29dd27) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3473      +/-   ##
==========================================
+ Coverage   85.66%   85.68%   +0.01%     
==========================================
  Files         137      137              
  Lines       10009    10019      +10     
==========================================
+ Hits         8574     8584      +10     
  Misses       1059     1059              
  Partials      376      376              
Impacted Files Coverage Δ
http3/roundtrip.go 93.55% <ø> (ø)
http3/body.go 78.57% <100.00%> (+0.79%) ⬆️
http3/client.go 90.41% <100.00%> (+0.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f29dd27...418532e. Read the comment docs.

@marten-seemann marten-seemann merged commit 61ca8e8 into master Jul 24, 2022
@marten-seemann marten-seemann deleted the fix-request-stream-cancelation-dont-close branch July 24, 2022 19:06
imroc added a commit to imroc/req that referenced this pull request Aug 3, 2022
sudarshan-reddy pushed a commit to sudarshan-reddy/quic-go that referenced this pull request Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants