Skip to content

Fix and unit test for #804: Race condition in LanguageServerWrapper - #808

Merged
rubenporras merged 2 commits into
eclipse-lsp4e:masterfrom
ChristophKaser:lswrapper_race
Sep 18, 2023
Merged

rubenporras merged 2 commits into
eclipse-lsp4e:masterfrom
ChristophKaser:lswrapper_race

Conversation

@ChristophKaser

Copy link
Copy Markdown
Contributor

Fixes #804

When ConnectionStreamProvider.start() throws an IOException, a race condition can occur that causes further attempts to start the language server to be ignored (issue 804)
initializeFuture.completeExceptionally(e);
stop();
return null;
throw new RuntimeException(e);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a reason for now just throw e?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, unfortunately e is of type Throwable and Function.apply can only throw an unchecked exception.

@mickaelistria mickaelistria left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me. I leave the final say (and merge if possible) to @rubenporras

@rubenporras
rubenporras merged commit 32fd663 into eclipse-lsp4e:master Sep 18, 2023
@rubenporras

Copy link
Copy Markdown
Contributor

thanks

@ChristophKaser

Copy link
Copy Markdown
Contributor Author

Thanks for merging!

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.

Race condition in LanguageServerWrapper on exception in StreamConnectionProvider.start()

3 participants