Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4974

try another srv-record on MongoSocketException

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Icon: Unknown Unknown
    • None
    • 4.0.5
    • Retryability
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      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)

      Attachments

        Activity

          People

            valentin.kovalenko@mongodb.com Valentin Kavalenka
            faucct@joom.com Nikita Sokolov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: