Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] [SourceKit] Cancel in-flight builds on editor.close #73375

Merged
merged 7 commits into from
May 2, 2024

Conversation

hamishknight
Copy link
Collaborator

6.0 cherry-pick of #73323

  • Explanation: Changes SourceKit to cancel in-flight AST builds for a given document on receiving editor.close.
  • Scope: Affects semantic requests for documents that have been closed
  • Issue: rdar://127126348
  • Risk: Fairly low, the change is relatively straightforward, and can be backed out by setting key.cancel_builds: 0 if needed.
  • Testing: Added tests to test suite
  • Reviewer: Ben Barham

There were a couple of accesses not guarded by
`CacheMtx`, introduce a couple of methods that
guard them, renaming `getASTProducer` while here.

Also make sure we don't ever insert a producer
after it has been purposefully removed by e.g a
close that removes the cached AST.
And move this into the constructor since it only
needs doing once.
This doesn't seem to be required by any of the
tests using it.
When closing a document, cancel any in-flight
builds happening for it.

rdar://127126348
@hamishknight hamishknight added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels May 1, 2024
@hamishknight hamishknight requested a review from bnbarham May 1, 2024 16:51
@hamishknight hamishknight requested a review from a team as a code owner May 1, 2024 16:51
We need to use a `std::function` here since it
escapes the lifetime of the call.

rdar://127362231
@hamishknight
Copy link
Collaborator Author

@swift-ci please test

@hamishknight hamishknight merged commit 247212d into apple:release/6.0 May 2, 2024
5 checks passed
@hamishknight hamishknight deleted the cancel-on-close-6.0 branch May 2, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants