Skip to content

If sourcekitd or clangd don’t respond to a request for 5 minutes, terminate them and use crash recovery to restore behavior #2137

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 May 6, 2025

This should be a last stop-gap measure in case sourcekitd or clangd get stuck, don’t respond to any requests anymore and don’t honor cancellation either. In that case we can restore SourceKit-LSP behavior by killing them and using the crash recovery logic to restore functionality.

rdar://149492159

@ahoppen ahoppen requested a review from bnbarham May 6, 2025 19:17
@ahoppen
Copy link
Member Author

ahoppen commented May 6, 2025

@swift-ci Please test

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

Very cool 😍

@ahoppen ahoppen force-pushed the terminate-unresponsive-clangd-sourcekitd branch from 562bf80 to 21e3bc3 Compare May 7, 2025 07:41
@ahoppen
Copy link
Member Author

ahoppen commented May 7, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 7, 2025

@swift-ci Please test Windows

…minate them and use crash recovery to restore behavior

This should be a last stop-gap measure in case sourcekitd or clangd get stuck, don’t respond to any requests anymore and don’t honor cancellation either. In that case we can restore SourceKit-LSP behavior by killing them and using the crash recovery logic to restore functionality.

rdar://149492159
@ahoppen ahoppen force-pushed the terminate-unresponsive-clangd-sourcekitd branch from 21e3bc3 to 14cfd50 Compare May 7, 2025 11:43
@ahoppen
Copy link
Member Author

ahoppen commented May 7, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 7, 2025

@swift-ci Please test Windows

2 similar comments
@ahoppen
Copy link
Member Author

ahoppen commented May 8, 2025

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented May 9, 2025

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 863c0e2 into swiftlang:main May 12, 2025
3 checks passed
@ahoppen ahoppen deleted the terminate-unresponsive-clangd-sourcekitd branch May 12, 2025 13:13
bnbarham added a commit to bnbarham/sourcekit-lsp that referenced this pull request May 12, 2025
…sponsive-clangd-sourcekitd"

This change is too risky for 6.2 at this point.
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