Skip to content

Commit

Permalink
Fixed test errors
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Kondaka <[email protected]>
  • Loading branch information
Krishna Kondaka committed Aug 23, 2024
1 parent 0740967 commit 0c2a2d2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ BulkResponse getResponse() {
return response;
}
String getExceptionMessage() {
return exception.getMessage();
return exception != null ? exception.getMessage() : "-";
}
}

Expand Down Expand Up @@ -199,14 +199,15 @@ public void execute(final AccumulatingBulkRequest bulkRequest) throws Interrupte
final Backoff backoff = Backoff.exponential(INITIAL_DELAY_MS, MAXIMUM_DELAY_MS).withMaxAttempts(maxRetries);
BulkOperationRequestResponse operationResponse;
BulkResponse response = null;
String exceptionMessage = "";
AccumulatingBulkRequest request = bulkRequest;
int attempt = 1;
do {
operationResponse = handleRetry(request, response, attempt);
if (operationResponse != null) {
final long delayMillis = backoff.nextDelayMillis(attempt++);
String exceptionMessage = "";
request = operationResponse.getBulkRequest();
response = operationResponse.getResponse();
exceptionMessage = operationResponse.getExceptionMessage();
if (delayMillis < 0) {
RuntimeException e = new RuntimeException(String.format("Number of retries reached the limit of max retries (configured value %d. Last exception message: %s)", maxRetries, exceptionMessage));
Expand Down

0 comments on commit 0c2a2d2

Please sign in to comment.