Skip to content

[SourceKit] Exit the SourceKitService process on a SIGTERM #71824

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
merged 1 commit into from
Feb 24, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Feb 23, 2024

Sending a SIGTERM to sourcekitd XPC service lead to very surprising results: XPC thought that the process was about to die and sends a Connection Interrupted notification to the client. But other than that, we didn’t actually handle the signal and the service stayed alive. This caused us to send a sema_disabled notification to the client but since the service never got relaunched, we never sent the corresponding sema_enabled notification.

To fix this, just properly die on SIGTERM by calling abort.

@ahoppen
Copy link
Member Author

ahoppen commented Feb 23, 2024

@swift-ci Please smoke test

Sending a `SIGTERM` to sourcekitd XPC service lead to very surprising results: XPC thought that the process was about to die and sends a Connection Interrupted notification to the client. But other than that, we didn’t actually handle the signal and the service stayed alive. This caused us to send a `sema_disabled` notification to the client but since the service never got relaunched, we never sent the corresponding `sema_enabled` notification.

To fix this, just properly die on `SIGTERM` by calling `abort`.
@ahoppen
Copy link
Member Author

ahoppen commented Feb 23, 2024

@swift-ci Please smoke test

@ahoppen ahoppen changed the title [SourceKit] Abort the SourceKitService proces on a SIGTERM [SourceKit] Exit the SourceKitService process on a SIGTERM Feb 23, 2024
@ahoppen
Copy link
Member Author

ahoppen commented Feb 23, 2024

@swift-ci Please smoke test

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Feb 23, 2024

@swift-ci Please smoke test

@ahoppen ahoppen merged commit 104ee13 into swiftlang:main Feb 24, 2024
@ahoppen ahoppen deleted the ahoppen/abort branch February 24, 2024 01:05
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