-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: 4.0.5
-
Component/s: Retryability
-
None
com.mongodb.internal.operation.OperationHelper#withReadConnectionSource could try getting another server until there are none left when opening connection fails, so the users would not get the MongoSocketException in case of mongo/mongos instances being moved
com.mongodb.MongoSocketException: 10-232-23-30.backend-mongos-production-aux.backend-mongos.svc.hoffman2.local at com.mongodb.ServerAddress.getSocketAddresses(ServerAddress.java:211) at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:75) at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65) at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127) at com.mongodb.internal.connection.UsageTrackingInternalConnection.open(UsageTrackingInternalConnection.java:50) at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.open(DefaultConnectionPool.java:435) at com.mongodb.internal.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:117) at com.mongodb.internal.connection.DefaultConnectionPool.get(DefaultConnectionPool.java:102) at com.mongodb.internal.connection.DefaultServer.getConnection(DefaultServer.java:90) at com.mongodb.internal.binding.ClusterBinding$ClusterBindingConnectionSource.getConnection(ClusterBinding.java:119) at com.mongodb.client.internal.ClientSessionBinding$SessionBindingConnectionSource.getConnection(ClientSessionBinding.java:135) at com.mongodb.internal.operation.FindOperation$1.call(FindOperation.java:628) at com.mongodb.internal.operation.FindOperation$1.call(FindOperation.java:625) at com.mongodb.internal.operation.OperationHelper.withReadConnectionSource(OperationHelper.java:462) at com.mongodb.internal.operation.FindOperation.execute(FindOperation.java:625) at com.mongodb.internal.operation.FindOperation.execute(FindOperation.java:77) at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:190) at com.mongodb.client.internal.FindIterableImpl.first(FindIterableImpl.java:189)
- related to
-
JAVA-5119 failed retries exception should show all unavailable servers
- Closed