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

Allow to fail fast when calling joinList. #69

Closed
JoseAlavez opened this issue May 30, 2020 · 1 comment
Closed

Allow to fail fast when calling joinList. #69

JoseAlavez opened this issue May 30, 2020 · 1 comment

Comments

@JoseAlavez
Copy link
Contributor

Hi spotify devs.

We use this library in combination with Netty, to consume REST APIs that provide us with single fetch contracts (as for example GET /domain/resource/{id}). In other words, when we require to fetch a batch of resources by id, we create individual asynchronous HTTP calls to the respective APIs and then join the completable futures using .collect(CompletableFutures.joinList()).

When our app is under heavy load and our fetch batch logic leads to individual HTTP calls that grows dramatically, we are seeing execution times that are higher than the timeouts specified for each completable future. This is caused due to the capacity of our executor to perform each HTTP call (and queuing) but also because the current implementation of joinList and allAsList utilizes CompletableFuture#allOf, which will wait until all the stages are completed to either continue normally or exceptionally.

I coded a solution for the described matter in #68, but forgot to create an issue, so independently if my contribution gets accepted or not, maybe the improvement can still happen.

Cheers!

@JoseAlavez JoseAlavez changed the title Provide allow to fail fast when calling joinList. Allow to fail fast when calling joinList. May 30, 2020
@JoseAlavez
Copy link
Contributor Author

Closing as the only thing pending here is the merge of #68

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

No branches or pull requests

1 participant