Skip to content

[5.9][sourcekitd] Allow client to enable use of dispatch barriers for open/edit/close on the message handling queue #66375

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

Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 6, 2023

  • Explanation: Previously, we relied on the client to make sure any open/edit/close request has finished executing before sending semantic queries about that updated source file, implicitly relying on clients to provide synchronization guarantees. This enables a mode in which sourcekitd can provide those synchronization guarantees:
    By default, all behavior stays the same. After the client sends a source.request.enable_request_barriers request, sourcekitd will issue all open/edit/close requests as dispatch barriers. This makes sure that all requests after the open/edit/close will only start being handled after the open/edit/close has finished.
  • Scope: No functionality change unless the new barrier mode is enabled
  • Risk: While changing anything surrounding queues can be considered risky, this should be low-risk since there is no functionality change unless the new barrier behavior is explicitly enabled
  • Testing: Ran unit test and SourceKit stress tester, both of which continue to use the code path that doesn’t use barriers
  • Issue: rdar://91202327
  • Reviewer: @bnbarham and @rintaro on [sourcekitd] Allow client to enable use of dispatch barriers for open/edit/close on the message handling queue #66013

@ahoppen ahoppen requested a review from a team as a code owner June 6, 2023 18:07
@ahoppen
Copy link
Member Author

ahoppen commented Jun 6, 2023

@swift-ci Please test

@ahoppen ahoppen changed the title [5.9] Use dispatch barriers for open/edit/close on the message handling queue [5.9][sourcekitd] Allow client to enable use of dispatch barriers for open/edit/close on the message handling queue Jun 6, 2023
@ahoppen ahoppen merged commit 72c7e36 into swiftlang:release/5.9 Jun 7, 2023
@ahoppen ahoppen deleted the ahoppen/5.9/sourcekitd-barriers branch June 7, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants