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 NPE when the server is stopped due to a failure during initialization #192

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

rubenporras
Copy link
Contributor

No description provided.

@rubenporras
Copy link
Contributor Author

@mickaelistria , thanks, you suggestion is better. I did a mistake with the PR, so we lost the previous PR, I created a new one.

@@ -243,7 +243,8 @@ public synchronized void start() throws IOException {
stop();
}
return null;
}).thenApply(unused -> {
});
initializeFuture.thenCombineAsync(initializeFuture, (unused1, unused2) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that future.thenCombineAsync(future, ...) is a good nor expected pattern.
I've a bit lost track about what you're willing to achieve. Maybe combining is not the right idea after all.
Maybe what you'd like to add here is just a line initializeFuture.exceptionallyAsync(this::stop) here before adding the other futures (which shouldn't be invoked anyway when previous future has exception)

@rubenporras
Copy link
Contributor Author

I think I got it right now :) Would you agree?

@mickaelistria mickaelistria merged commit 84ce3f7 into eclipse:master Jul 26, 2022
@mickaelistria
Copy link
Contributor

I think I got it right now :) Would you agree?

Yes, thanks!

@rubenporras rubenporras deleted the fixNPE branch July 26, 2022 13:05
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