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

Invoke RetryPolicy#retry in the blocking executor. #393

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

jpd236
Copy link
Collaborator

@jpd236 jpd236 commented Feb 1, 2021

When using the synchronous RequestQueue, retry will be invoked in the
NetworkDispatcher thread. Clients may be relying on the ability to
perform blocking operations in retry(); a common example would be
clearing auth tokens in the event of an auth error, which may
require disk I/O.

In order to keep the same API contract when using AsyncRequestQueue,
rework NetworkUtility to permit BasicAsyncNetwork to invoke retry in
the blocking executor.

When using the synchronous RequestQueue, retry will be invoked in the
NetworkDispatcher thread. Clients may be relying on the ability to
perform blocking operations in retry(); a common example would be
clearing auth tokens in the event of an auth error, which may
require disk I/O.

In order to keep the same API contract when using AsyncRequestQueue,
rework NetworkUtility to permit BasicAsyncNetwork to invoke retry in
the blocking executor.
}
} else {
// 3xx? No reason to retry.
throw new ServerError(networkResponse);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? You have it again below

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, just needed to generalize the comment. Done.

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

Successfully merging this pull request may close these issues.

2 participants