Skip to content

Fix leak in HandlerMethodRunner::$cancellations#72

Open
sj-i wants to merge 1 commit into
phpactor:masterfrom
sj-i:fix-cancellation-leak
Open

Fix leak in HandlerMethodRunner::$cancellations#72
sj-i wants to merge 1 commit into
phpactor:masterfrom
sj-i:fix-cancellation-leak

Conversation

@sj-i

@sj-i sj-i commented May 19, 2026

Copy link
Copy Markdown

HandlerMethodRunner::dispatch() inserted a CancellationTokenSource per RequestMessage but never unset the entry.

Found this while testing reliforp/reli-prof (a PHP memory profiler I work on) against a Phpactor instance. The heap-snapshot diffing surfaced an unbounded accumulation of Amp\CancellationTokenSource indexed by LSP request id, which traced back to this dispatch path.

This fixes zed-industries/zed#57121.

HandlerMethodRunner::dispatch() inserted a CancellationTokenSource per RequestMessage but
never unset the entry.

This fixes zed-industries/zed#57121.
Found while testing reliforp/reli-prof, a PHP memory profiler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant