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

Add missing synchronization guards when accessing startedServers Set #163

Merged
merged 1 commit into from
Jun 29, 2022

Conversation

sebthom
Copy link
Member

@sebthom sebthom commented Jun 28, 2022

No description provided.

@sebthom sebthom changed the title Add missing synchronization guards when accessing to startedServers Set Add missing synchronization guards when accessing startedServers Set Jun 28, 2022
@mickaelistria
Copy link
Contributor

Which problem is it fixing? Do you have steps to reproduce issues that are fixed with this patch?

@sebthom
Copy link
Member Author

sebthom commented Jun 29, 2022

I saw that the synchronization blocks are missing while investigating the deadlocks.

The current code as is technically broken. Either all access paths need to be synchronized or none.

@mickaelistria
Copy link
Contributor

Either all access paths need to be synchronized or none.

Actually, if the structure is sufficiently thread-safe on access, read-only operations may not need to be synchronized.

@sebthom
Copy link
Member Author

sebthom commented Jun 29, 2022

The methods that are currently unguarded iterate over a set that might by modified by other methods at the same time. This basically begs for potential ConcurrentModificationExceptions.

I would agree with you that this change might not be required - but only if LanguageServiceAccessor was an internal class where you have control over which of its methods are called when by other code. But this is a public class where all methods can be concurrently invoked by external code as pleased.

@mickaelistria mickaelistria merged commit 399a922 into eclipse-lsp4e:master Jun 29, 2022
@mickaelistria
Copy link
Contributor

OK, thanks!

@sebthom sebthom deleted the patch-5 branch July 1, 2022 11:43
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