[JAVA-187] Mongo construction does not cause error (when server down) Created: 12/Oct/10  Updated: 29/Oct/10  Resolved: 27/Oct/10

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 2.2
Fix Version/s: 2.3

Type: Bug Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If you do something as simple as Mongo() you will not get an error if the server isn't running until you run a command or query. (isMaster is no long called unless the pair/list constructor is used)

This is a byproduct of the new replicaset discovery and the ability to connect directly to a non-master node therein. We should probably put the immediate error trigger back in when constructing a Mongo instance. To do this I suggest adding a constructor (or set) that takes a bool doNotAddAllNodes, or something like that.

Right now the constructors are not very helpful in describing the expected behavior. Does the driver find the master or other slaves/nodes? If so which node is actually used?



 Comments   
Comment by auto [ 27/Oct/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: testmaster for single servers on creation JAVA-187
http://github.com/mongodb/mongo-java-driver/commit/ac897e55e794febdef65c88059e44a54a60b4b3d

Generated at Thu Feb 08 08:51:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.