Skip to content

Cancel the handler context when a stream is reset - #38

Merged
bogdanfinn merged 1 commit into
bogdanfinn:masterfrom
pagpeter:http2-cancel-handler-ctx-on-reset
Oct 26, 2026
Merged

bogdanfinn merged 1 commit into
bogdanfinn:masterfrom
pagpeter:http2-cancel-handler-ctx-on-reset

Conversation

@pagpeter

Copy link
Copy Markdown

When the server reset a stream because of a stream error, the handler's request context stayed live, so a handler waiting on it never returned. Only a client RST_STREAM canceled it.

Port golang.org/x/net/http2 8aa6dbf4 (CL 585595, golang/go#67036) to http2 and to the bundled server in h2_bundle.go: closeStream cancels the stream's context.

When the server reset a stream because of a stream error, the handler's
request context stayed live, so a handler waiting on it never returned.
Only a client RST_STREAM canceled it.

Port golang.org/x/net/http2 8aa6dbf4 (CL 585595, golang/go#67036) to
http2 and to the bundled server in h2_bundle.go: closeStream cancels the
stream's context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pagpeter
pagpeter force-pushed the http2-cancel-handler-ctx-on-reset branch from b46f7e7 to 8f43832 Compare October 26, 2026 10:30
@bogdanfinn
bogdanfinn merged commit b1be01a into bogdanfinn:master Oct 26, 2026
1 check passed
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