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

If two instances of the same standalone server is passed to MongoClient, the driver removes it from the cluster monitor

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.12.3, 3.0.0
    • Affects Version/s: 2.12.1
    • Component/s: Cluster Management
    • None
    • Environment:
      Java 1.7
      Debian GNU/Linux
      Single node mongo (dev)
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hi,

      I've just upgraded our dev. environnement from Mongo Java Driver 2.11.4 to 2.12.1 and I'm getting the following error at each startup of our application :

      mai 14, 2014 12:05:40 PM com.mongodb.MultiServerCluster handleStandAloneChanged
      Grave: Expecting a single StandAlone, but found more than one.  Removing localhost:27017 from client view of cluster.
      

      FYI, I'm using MongoClient(List<ServerAddress> seeds, MongoClientOptions options) constructor so that's my ClusterConnectionMode is "Multiple".

      • In production / staging, I'm providing multiple servers members of replicaset without any issue
      • In devel, I'm providing only a single ServerAddress, localhost:27017 which seems to be the source of this issue

      Going deeper into Mongo Java driver code, I've found that my *ClusterSettings* hosts attribute, contains duplicate values : I can find twice "localhost:27017" ! It seems that hosts should be a Set instead of List.

      Regards,

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            drazzib Damien Raude-Morvan
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None