Skip to content

Correctly cleanup HTTP/2 connection channel#88

Open
aryan-25 wants to merge 2 commits into
swift-server:mainfrom
aryan-25:close-http2-connections-upon-cancellation
Open

Correctly cleanup HTTP/2 connection channel#88
aryan-25 wants to merge 2 commits into
swift-server:mainfrom
aryan-25:close-http2-connections-upon-cancellation

Conversation

@aryan-25

Copy link
Copy Markdown
Collaborator

Motivation:

The inbound HTTP/2 stream iterator can exit when the server task is cancelled, or when the stream multiplexer finishes or throws. However, when this happens, we currently do not close the connection channel. We should fix this.

Modifications:

  • Updated the serveHTTP2Connection method to also close the connection channel when the inbound stream iteration exits.
  • Added a regression test that checks the connection channel is closed when the server task is cancelled during an active connection. This test indefinitely stalls before this patch.

Result:

Active HTTP/2 connections are now cleaned up correctly when the inbound stream iteration exits.

@aryan-25 aryan-25 added the 🔨 semver/patch No public API change. label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants