Repository navigation
Fixes hangs and leaks when cancelling jobs - #367
Merged
ArquintL merged 1 commit intoOct 30, 2026
Merged
Conversation
This was referenced Oct 8, 2026
- A task that is cancelled before it starts never completes its message queue. Hence, the job's message stream never completes and the job's slot is never freed. The JobActor now completes the queue on the task's behalf; `MessageStreamingTask.cancelledBeforeStart` reliably distinguishes such a task from one that is cancelled while it is running. - Cancelling an AST construction fails the dependent verification job's handle with a `CancellationException`, which `initializeProcess` did not handle, leaking the verification job's slot. - A job's actor is now stopped whenever the job's message queue completes, not only for verification jobs. This fixes leaking the actors of AST jobs and removes the need for frontends to stop job actors themselves: the manual `PoisonPill`s in the LSP frontend and the HTTP discard route are gone, and `discardAstJobLookup` is replaced by the now public `discardAstJob`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
rayman2000
force-pushed
the
interrupt-jobs-2-lifecycle-fixes
branch
from
October 30, 2026 11:14
d400fdc to
cd5ef66
Compare
rayman2000
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #357, which should be merged first.
Fixes three problems with cancelled jobs. The first two also affect the existing stop paths of the LSP frontend and the HTTP API.
MessageStreamingTask.cancelledBeforeStartdistinguishes such a task from one that is cancelled while running, which aFutureTaskalone cannot.CancellationException, whichinitializeProcessdid not handle. That job's slot leaked.PoisonPills in the LSP frontend and the HTTP discard route are gone, anddiscardAstJobLookupis replaced by the now publicdiscardAstJob.TaskInterruptionTestscovers the first fix.🤖 Generated with Claude Code