[ty] Cancel superseded queued uv requests - #28108
Open
MichaReiser wants to merge 1 commit into
Open
Conversation
Skip an older queued synchronization when a newer request replaces it. Running uv processes are allowed to finish. Skipped jobs still report completion so poll_sync can submit the latest request without adding multiple outstanding jobs for one environment. Retry a canceled request if later edits make it current again.
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 97.69%. The percentage of expected errors that received a diagnostic held steady at 93.71%. The number of fully passing files held steady at 110/136. |
Memory usage reportMemory usage unchanged ✅ |
|
| Project | Old Time | New Time | Change |
|---|---|---|---|
dd-trace-py |
2.62s | 1.06s | -59% |
Performance comparison unavailableThe base and head of this comparison were measured with different runner settings, so their benchmark values are not directly comparable. What changed between base and head:
Re-run the base with the same settings to get a valid performance comparison. Comparing Footnotes |
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.
Summary
Now that we queue all scripts on startup, I thought it's important to have a way to cancel already queued sync requests if they're superseded by a new sync.
The implementation here is relatively simple. We use our existing
CancellationTokenand check it before a worker invokesuv metadata. This is similar to what we do in the LSP.The downside of this is that the new request for the cancelled script will, again, be queued at the back. I think this is fine for now. We can explore with more elaborate schemas later.
Test Plan
The focused CLI, LSP, and file-watching tests pass.