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

Suggested solutions for Request3Callbacks don't handle errors #25

Open
kirmanak opened this issue Oct 24, 2021 · 0 comments
Open

Suggested solutions for Request3Callbacks don't handle errors #25

kirmanak opened this issue Oct 24, 2021 · 0 comments

Comments

@kirmanak
Copy link

As far as I understand the current revision of Using callbacks suggests that using CountDownLatch is the best approach to solve the problem.

However, the provided solution doesn't work even if one of the requests fails. When a request fails, the error is simply logged on Request3Callbacks.kt#L34. countDown() isn't called in that case. Because of that, the thread will never return from await() call.

The same goes for the second suggested solution (AtomicInteger). The counter isn't incremented if a request fails. Because of that, when all requests are completed, the counter won't be equal to the count of repositories.

I am not sure if this should be fixed or even mentioned in the docs, but I think it should be at least listed as a known issue.

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