Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 7, 2023

@ahoppen ahoppen requested a review from a team as a code owner June 7, 2023 23:29
@ahoppen
Copy link
Member Author

ahoppen commented Jun 7, 2023

@swift-ci Please test

…dent`

`requestIsEnableBarriers` and `requestIsBarrier` call `SKDUIDFromUIdent`. What I didn’t know, was that `SKDUIDFromUIdent` can send XPC requests to the client to translate UIDs via `sourcekitd_set_uid_handlers`.

Since we were calling `requestIsEnableBarriers` directly from the XPC server’s main queue, and the UID handler sends an XPC request synchronously, we could get into a deadlock situation.

Immediately jump onto a serial background queue (`msgHandlingQueue`) in `sourcekitdServer_peer_event_handler` so that the main queue is free to execute the UID handler. This more closely matches the behavior before I introduced barriers as well, where we were always immediately jumping onto a concurrrent `msgHandlingQueue`.
@ahoppen ahoppen force-pushed the ahoppen/5.9/deadlock branch from 17ad3f8 to ebd979b Compare June 7, 2023 23:34
@ahoppen
Copy link
Member Author

ahoppen commented Jun 7, 2023

@swift-ci Please test

@ahoppen ahoppen merged commit 9e48895 into swiftlang:release/5.9 Jun 8, 2023
@ahoppen ahoppen deleted the ahoppen/5.9/deadlock branch June 8, 2023 15:56
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