Skip to content

Send SIGKILL to swift-frontend indexing processes #1500

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
Jun 26, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 20, 2024

We were sending SIGINT to swift-frontend processes if they didn’t terminate after 2 minutes. However, swift-frontend doesn’t listen to SIGINT.

If a task running waitUntilExitStoppingProcessOnTaskCancellation is cancelled and the process doesn’t terminate on a SIGINT after 2 seconds, kill it.

rdar://130103147

@ahoppen ahoppen requested review from bnbarham and hamishknight June 20, 2024 23:04
@ahoppen ahoppen requested a review from benlangmuir as a code owner June 20, 2024 23:04
@ahoppen
Copy link
Member Author

ahoppen commented Jun 20, 2024

@swift-ci Please test

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Yeah we really ought to fix swift-frontend to respect SIGINT

Comment on lines 368 to 370
// than 2 minutes in practice, so this indicates that the compiler has entered a loop and we probably won't make any
// progress here. We will try indexing the file again when it is edited or when the project is re-opened.
// 2 minutes have been chosen arbitrarily.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this comment be updated/moved?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch 👍🏽

@ahoppen ahoppen force-pushed the fix-index-cancellation branch 2 times, most recently from cce2912 to 6e3fdc7 Compare June 26, 2024 07:42
We were sending `SIGINT` to `swift-frontend` processes if they didn’t terminate after 2 minutes. However, `swift-frontend` doesn’t listen to `SIGINT`.

If a task running `waitUntilExitStoppingProcessOnTaskCancellation` is cancelled and the process doesn’t terminate on a `SIGINT` after 2 seconds, kill it.

rdar://130103147
@ahoppen ahoppen force-pushed the fix-index-cancellation branch from 6e3fdc7 to 2ba180b Compare June 26, 2024 07:43
@ahoppen
Copy link
Member Author

ahoppen commented Jun 26, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit d324d71 into swiftlang:main Jun 26, 2024
3 checks passed
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