Skip to content

Commit a1b5773

Browse files
committed
Add RetryableWriteError label when retryWrites=true
JAVA-3721
1 parent 31e438f commit a1b5773

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ public void onResult(final BsonDocument result, final Throwable t) {
494494
} else {
495495
MongoException writeConcernBasedError = ProtocolHelper.createSpecialException(result,
496496
connection.getDescription().getServerAddress(), "errMsg");
497-
if (writeConcernBasedError != null && shouldAttemptToRetryWrite(true, writeConcernBasedError, maxWireVersion)) {
497+
if (writeConcernBasedError != null && shouldAttemptToRetryWrite(retryWrites, writeConcernBasedError, maxWireVersion)) {
498498
if (retryWrites && !isSecondAttempt) {
499499
retryExecuteBatchesAsync(binding, batch,
500500
new MongoWriteConcernWithResponseException(writeConcernBasedError, result),

0 commit comments

Comments
 (0)