Skip to content

h3: Remove streams on StreamClosed #309

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

G1gg1L3s
Copy link

@G1gg1L3s G1gg1L3s commented Jul 6, 2025

Hi! I was playing around with HTTP3 in Hypercorn and noticed significant memory leaks during long-lived connections.

After some investigation, I discovered that Hypercorn doesn't properly remove finished streams from the H3Protocol.streams dict. This leads to unbounded memory growth over time.

This PR fixes the issue. Interestingly, the solution is just one line: the StreamClosed event was already being handled in the H3 protocol, but the handler didn't actually remove the stream.

However, there is another memory leak, this time in the aioquic library itself, which I addresses in this PR - aiortc/aioquic#590. Once (and if) that fix is merged, Hypercorn should bump its aioquic dependency to ensure that both memory leaks are fully resolved.

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.

1 participant