Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.

Backoff HTTP requests on IO Exceptions. #617

Open
wants to merge 2 commits into
base: master-1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,10 @@ public void initialize(HttpRequest request) throws IOException {
.setMultiplier(2).build(),
sleeper, ignoredResponseCodes));

// Retry immediately on IOExceptions.
// Similarly back off on IOExceptions.
LoggingHttpBackOffIOExceptionHandler loggingBackoffHandler =
new LoggingHttpBackOffIOExceptionHandler(BackOff.ZERO_BACKOFF);
new LoggingHttpBackOffIOExceptionHandler(
new ExponentialBackOff.Builder().setNanoClock(nanoClock).setMultiplier(2).build());
request.setIOExceptionHandler(loggingBackoffHandler);

// Set response initializer
Expand Down