Skip to content
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

fix(lsp): re-enable the per resource configuration without a deadlock #10625

Merged
merged 7 commits into from
May 20, 2021

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented May 13, 2021

This PR rewrites the way per resource configuration is handled in the language server.

There isn't specifically a test that tests for this deadlock yet, as I need to refactor the language server integration tests to a new structure that supports 2 way communication, which we have in the benchmark harness, but need to share with the integration tests.

cli/lsp/config.rs Show resolved Hide resolved
cli/lsp/config.rs Outdated Show resolved Hide resolved
@kitsonk kitsonk force-pushed the fix_config_deadlock branch from d43164c to adabd40 Compare May 17, 2021 23:42
@kitsonk kitsonk requested review from bnoordhuis, lucacasonato and ry May 18, 2021 00:54
@kitsonk
Copy link
Contributor Author

kitsonk commented May 18, 2021

I've added a benchmark test that replicates the issue that I encountered which required the feature to be removed. I thought about just leaving it as a integration test, but it is a good test to have additional benchmarks for the lsp and it is significantly different than the other ones we have.

@kitsonk kitsonk force-pushed the fix_config_deadlock branch from 479a960 to 0114a3a Compare May 18, 2021 01:47
cli/lsp/config.rs Outdated Show resolved Hide resolved
@kitsonk kitsonk force-pushed the fix_config_deadlock branch from 0114a3a to 947e09e Compare May 19, 2021 00:58
@kitsonk kitsonk requested a review from bnoordhuis May 19, 2021 05:10
Copy link
Contributor

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

Reviewed lightly due to time pressure but LGTM.

if self.client_capabilities.workspace_configuration
&& !self
.settings
.try_read()
Copy link
Contributor

Choose a reason for hiding this comment

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

When would you expect this to fail?

I'd probably just send unconditionally, without checking .specifiers first, and let the receiver handle it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, when I was pondering this offline I came to the same thought, it would put an extra message in the queue, but it would get cleared down in a much narrower lock situation.

kitsonk added 7 commits May 20, 2021 17:49

Verified

This commit was signed with the committer’s verified signature.
kitsonk Kitson Kelly

Verified

This commit was signed with the committer’s verified signature.
kitsonk Kitson Kelly

Verified

This commit was signed with the committer’s verified signature.
kitsonk Kitson Kelly

Verified

This commit was signed with the committer’s verified signature.
kitsonk Kitson Kelly

Verified

This commit was signed with the committer’s verified signature.
kitsonk Kitson Kelly

Verified

This commit was signed with the committer’s verified signature.
kitsonk Kitson Kelly

Verified

This commit was signed with the committer’s verified signature.
kitsonk Kitson Kelly
@kitsonk kitsonk force-pushed the fix_config_deadlock branch from 947e09e to d793599 Compare May 20, 2021 08:06
@kitsonk kitsonk merged commit 014d8d5 into denoland:main May 20, 2021
@kitsonk kitsonk deleted the fix_config_deadlock branch May 20, 2021 09:56
piscisaureus pushed a commit that referenced this pull request May 31, 2021

Partially verified

This commit is signed with the committer’s verified signature.
piscisaureus’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
…#10625)

Fixes #10603
piscisaureus pushed a commit that referenced this pull request May 31, 2021

Partially verified

This commit is signed with the committer’s verified signature.
piscisaureus’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
…#10625)

Fixes #10603
piscisaureus pushed a commit that referenced this pull request May 31, 2021

Partially verified

This commit is signed with the committer’s verified signature.
piscisaureus’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
…#10625)

Fixes #10603
piscisaureus pushed a commit that referenced this pull request May 31, 2021

Partially verified

This commit is signed with the committer’s verified signature.
piscisaureus’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
…#10625)

Fixes #10603
piscisaureus pushed a commit that referenced this pull request May 31, 2021

Partially verified

This commit is signed with the committer’s verified signature.
piscisaureus’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
…#10625)

Fixes #10603
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.

None yet

2 participants