Skip to content

Fix memory leak potential by not calling op.cancel()#191

Merged
emcfarlane merged 4 commits into
connectrpc:mainfrom
sudorandom:fix-memory-leak
Jun 30, 2026
Merged

Fix memory leak potential by not calling op.cancel()#191
emcfarlane merged 4 commits into
connectrpc:mainfrom
sudorandom:fix-memory-leak

Conversation

@sudorandom

@sudorandom sudorandom commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Ensures the Transcoder request sub-context is always cancelled and correctly propagated to downstream handlers.

Changes

  • Added defer op.cancel() to ServeHTTP to prevent context leaks.
  • Updated ServeHTTP to pass op.request (carrying the sub-context) to downstream handlers on
    pass-through and unknown route paths.

@emcfarlane

Copy link
Copy Markdown
Collaborator

Thanks for the fix! Can you clarify: "Updated ServeHTTP to pass op.request (carrying the sub-context) to downstream handlers on pass-through and unknown route paths."?

@sudorandom sudorandom changed the title fix: remove memory leak potential by not calling op.cancel() Fixes memory leak potential by not calling op.cancel() Jun 11, 2026
@sudorandom sudorandom changed the title Fixes memory leak potential by not calling op.cancel() Fix memory leak potential by not calling op.cancel() Jun 11, 2026
Signed-off-by: Kevin McDonald <kevin@sudorandom.com>
Signed-off-by: Kevin McDonald <kevin@sudorandom.com>
Signed-off-by: Kevin McDonald <kevin@sudorandom.com>
@emcfarlane emcfarlane merged commit ee25c3a into connectrpc:main Jun 30, 2026
4 checks 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