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

Short-circuit CompletableFuture returned by Startables#deepStart on exception #5930

Merged
merged 2 commits into from
Jan 14, 2023

Conversation

pivovarit
Copy link
Contributor

@pivovarit pivovarit commented Sep 30, 2022

CompletableFuture.allOf returns a future that completes only when all provided futures complete either successfully or exceptionally, which means that when one future fails, you still need to wait until the remaining futures complete... only to be presented with the exception that failed at the beginning.

This is safe, according to JMM.

Fixes: #2249

Recycled #2251

@pivovarit pivovarit marked this pull request as ready for review September 30, 2022 19:23
@pivovarit pivovarit requested a review from a team as a code owner September 30, 2022 19:23
@eddumelendez eddumelendez added this to the next milestone Jan 14, 2023
@eddumelendez eddumelendez merged commit 242a139 into testcontainers:main Jan 14, 2023
@pivovarit pivovarit deleted the deepstart-shortcircuit branch January 14, 2023 19:20
@eddumelendez
Copy link
Member

Sorry for the delay and thanks for the contribution @pivovarit ! This is now merged in main branch and will be available in the next release.

@pivovarit
Copy link
Contributor Author

No worries, I know how it is to maintain OSS projects :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail fast in Startables#deepStart
2 participants