Skip to content

[ty] Cancel superseded queued uv requests - #28108

Open
MichaReiser wants to merge 1 commit into
micha/ty-script-preparation-watchingfrom
micha/ty-cancel-superseded-uv-requests
Open

[ty] Cancel superseded queued uv requests#28108
MichaReiser wants to merge 1 commit into
micha/ty-script-preparation-watchingfrom
micha/ty-cancel-superseded-uv-requests

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Aug 27, 2026

Copy link
Copy Markdown
Member

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 CancellationToken and check it before a worker invokes uv 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.

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.
@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label Aug 27, 2026
@astral-sh-bot

astral-sh-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The 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.

@astral-sh-bot

astral-sh-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Large timing changes:

Project Old Time New Time Change
dd-trace-py 2.62s 1.06s -59%

Full report with detailed diff (timing results)

@MichaReiser
MichaReiser requested review from Gankra and zsol August 27, 2026 14:58
@MichaReiser
MichaReiser marked this pull request as ready for review August 27, 2026 14:58
@MichaReiser
MichaReiser requested a review from a team as a code owner August 27, 2026 14:58
@codspeed-hq

codspeed-hq Bot commented Aug 27, 2026

Copy link
Copy Markdown

Performance comparison unavailable

The 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 micha/ty-cancel-superseded-uv-requests (f9cca04) with micha/ty-script-preparation-watching (94b0ebf)1

Open in CodSpeed

Footnotes

  1. No successful run was found on micha/ty-script-preparation-watching (aed1c7f) during the generation of this report, so e70d13c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@zsol zsol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants