Skip to content

Commit c5941ef

Browse files
committed
1 parent e9c0c4b commit c5941ef

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

driver-core/src/main/com/mongodb/internal/operation/AsyncOperationHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static <D, T> void createReadCommandAndExecuteAsync(
335335
static <R> AsyncCallbackSupplier<R> decorateReadWithRetriesAsync(final RetryState retryState, final OperationContext operationContext,
336336
final AsyncCallbackSupplier<R> asyncReadFunction) {
337337
return new RetryingAsyncCallbackSupplier<>(retryState, onRetryableReadAttemptFailure(operationContext),
338-
CommandOperationHelper::shouldAttemptToRetryRead, callback -> {
338+
CommandOperationHelper::loggingShouldAttemptToRetryRead, callback -> {
339339
logRetryExecute(retryState, operationContext);
340340
asyncReadFunction.get(callback);
341341
});

driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static boolean isNamespaceError(final Throwable t) {
166166
}
167167
}
168168

169-
static boolean shouldAttemptToRetryRead(final RetryState retryState, final Throwable attemptFailure) {
169+
static boolean loggingShouldAttemptToRetryRead(final RetryState retryState, final Throwable attemptFailure) {
170170
assertFalse(attemptFailure instanceof ResourceSupplierInternalException);
171171
boolean decision = isRetryableException(attemptFailure)
172172
|| (attemptFailure instanceof MongoSecurityException
@@ -178,7 +178,7 @@ static boolean shouldAttemptToRetryRead(final RetryState retryState, final Throw
178178
}
179179

180180
static boolean loggingShouldAttemptToRetryWriteAndAddRetryableLabel(final RetryState retryState, final Throwable attemptFailure) {
181-
Throwable attemptFailureNotToBeRetried = getAttemptFailureNotToRetryOrAddRetryableLabel(retryState, attemptFailure);
181+
Throwable attemptFailureNotToBeRetried = getWriteAttemptFailureNotToBeRetriedOrAddRetryableLabel(retryState, attemptFailure);
182182
boolean decision = attemptFailureNotToBeRetried == null;
183183
if (!decision && retryState.attachment(AttachmentKeys.retryableCommandFlag()).orElse(false)) {
184184
logUnableToRetry(
@@ -189,14 +189,14 @@ static boolean loggingShouldAttemptToRetryWriteAndAddRetryableLabel(final RetryS
189189
}
190190

191191
static boolean shouldAttemptToRetryWriteAndAddRetryableLabel(final RetryState retryState, final Throwable attemptFailure) {
192-
return getAttemptFailureNotToRetryOrAddRetryableLabel(retryState, attemptFailure) != null;
192+
return getWriteAttemptFailureNotToBeRetriedOrAddRetryableLabel(retryState, attemptFailure) != null;
193193
}
194194

195195
/**
196196
* @return {@code null} if the decision is {@code true}. Otherwise, returns the {@link Throwable} that must not be retried.
197197
*/
198198
@Nullable
199-
private static Throwable getAttemptFailureNotToRetryOrAddRetryableLabel(final RetryState retryState, final Throwable attemptFailure) {
199+
private static Throwable getWriteAttemptFailureNotToBeRetriedOrAddRetryableLabel(final RetryState retryState, final Throwable attemptFailure) {
200200
Throwable failure = attemptFailure instanceof ResourceSupplierInternalException ? attemptFailure.getCause() : attemptFailure;
201201
boolean decision = false;
202202
MongoException exceptionRetryableRegardlessOfCommand = null;

driver-core/src/main/com/mongodb/internal/operation/SyncOperationHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static <R> Supplier<R> decorateWriteWithRetries(final RetryState retryState,
332332
static <R> Supplier<R> decorateReadWithRetries(final RetryState retryState, final OperationContext operationContext,
333333
final Supplier<R> readFunction) {
334334
return new RetryingSyncSupplier<>(retryState, onRetryableReadAttemptFailure(operationContext),
335-
CommandOperationHelper::shouldAttemptToRetryRead, () -> {
335+
CommandOperationHelper::loggingShouldAttemptToRetryRead, () -> {
336336
logRetryExecute(retryState, operationContext);
337337
return readFunction.get();
338338
});

0 commit comments

Comments
 (0)