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

ExponentialBackoffPolicy should add randomness to backoff interval #30

Open
wheezil opened this issue Sep 19, 2019 · 2 comments
Open

ExponentialBackoffPolicy should add randomness to backoff interval #30

wheezil opened this issue Sep 19, 2019 · 2 comments

Comments

@wheezil
Copy link

wheezil commented Sep 19, 2019

ExponentialBackoffPolicy.shouldRetry() uses a completely deterministic wait time. This can lead to continued failures in the face of multiple parallel processes launched more-or-less simultaneously, because each task will restart its attempt at the same time. While this case may seem contrived, it is exactly what happens when we attempt to launch 100s of tasks in Hadoop that perform parallel reads on a set of "part" files stored in ADL.

Suggested solution:

private void wait(int milliseconds) {
        if (milliseconds <= 0) {
            return;
        }
        try {
            Thread.sleep(milliseconds / 2 + randomInt(milliseconds / 2 + 1));

where randomInt() could be Random.nextInt() if a highly random seed were used.

@wheezil
Copy link
Author

wheezil commented Sep 19, 2019

I'd like a second opinion about whether this will help, as I don't know how ADL counts its requests. The doc says "no more than 12000 reads/hour". But how long is the window used to accumulate the requests? If the window really is an hour long, then piling on 12000 requests all at once will render the ADL store unusable for nearly an hour. That's a really long time to wait.

@rahuldutta90
Copy link
Contributor

@wheezil i will confirm the internal throttling logic and get back to you

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

2 participants