Skip to content

Commit dd62a2f

Browse files
vbabaninrozza
andauthored
Update driver-core/src/main/com/mongodb/internal/connection/OperationContext.java
Co-authored-by: Ross Lawley <[email protected]>
1 parent 755f43a commit dd62a2f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

driver-core/src/main/com/mongodb/internal/connection/OperationContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ public void onAttemptFailure(final Throwable failure) {
250250
return;
251251
}
252252

253+
// As per spec: sharded clusters deprioritize on any error, other topologies only on overload
253254
boolean isSystemOverloadedError = failure instanceof MongoException
254255
&& ((MongoException) failure).hasErrorLabel(SYSTEM_OVERLOADED_ERROR_LABEL);
255256
if (clusterType == ClusterType.SHARDED || isSystemOverloadedError) {

0 commit comments

Comments
 (0)