Skip to content

Suggested solutions for Request3Callbacks don't handle errors #25

Open
@kirmanak

Description

@kirmanak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions