[CXX-647] fail to connect to replica set Created: 04/Aug/15 Updated: 04/Sep/15 Resolved: 04/Sep/15 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | API |
| Affects Version/s: | legacy-1.0.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Judy Han [X] | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
when I use simple connection string to connect, it works.
when I use connection string for replica set to connect:
I got following exceptions:
Here is the related code:
when I try to login from command line it seems to work:
|
| Comments |
| Comment by Judy Han [X] [ 04/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks very much for your feedback! I will check with my manager on this to see what we can do. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 04/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
OK. I'm going to close this ticket out then, and you can watch As far as upgrading to a newer driver version: yes, of course you must consider the stability, and you should first upgrade your development or test environment, certainly not production, and do all necessary validation and testing before making the upgrade. As far as integrating the fix into your local legacy-1.0.0 tree, that is up to you, but please realize that that patch hasn't even exited code review yet! So, based on your caution re upgrades, you should consider carefully whether that is an acceptable risk, and of course do all necessary testing. However, the confirmation that it works for you is very helpful. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Judy Han [X] [ 04/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Andrew, Regarding getting the newer version of legacy code, we need to consider the stability of our code because of the tests involved with the existing version. I will add the above fix in legacy1.0.0 for now and will get newer version at our scheduled time. Thanks for the advice. Please feel free to close this ticket. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Great! I'm happy we figured that out. As far as your auth issue, I suspect that that may be related to Also, as a general recommendation, I think it would be advisable for you to upgrade away from legacy-1.0.0 to the most recent stable, legacy-1.0.5, as several important bug fixes have landed since legacy-1.0.0. If it turns out that | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Judy Han [X] [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Andrew,
"auth failed", code: 18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also, is there any possibility that an early call to mongo::client::terminate is taking place? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Judy.Han - From the stack trace you have posted, it appears that you are calling connect from an ACE thread. What is the lifecycle of that thread with respect to the call to mongo::client::initialize? In other words, is there a definite happens before relationship between call to mongo::client::initialize and the creation of the thread that calls mongo::ConnectionString::connect? Is there any possibility that the call to ConnectionString::connect from the ACE thread is racing with, or occurs before, the call to mongo::client::initialize? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Judy Han [X] [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
something wrong with ReplicaSetMonitor? As you mentioned, it's almost like ReplicaSetMonitor::initialize() is not called. And we do not have any problem with this call. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Judy Han [X] [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Andrew,
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Judy.Han - Could you please confirm that you are using legacy-1.0.0 as stated in the "Affects Version" field? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Judy Han [X] [ 03/Sep/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Adam, I tried it again, this time, the exception is not caught and I got a core dump. Following are the relevant information:
Also following are printed on the screen:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Adam Midvidy [ 26/Aug/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Judy, if possible could you provide some more information - ideally a stacktrace from the exception being thrown as well as the text of your program or any logging output you have from the driver. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Judy Han [X] [ 06/Aug/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Adam,
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Adam Midvidy [ 05/Aug/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hey Judy.Han, How are you initializing the driver? It looks like you would get that error if you were not actually creating a mongo::client::GlobalInstance object (nor calling mongo::client::initialize) at the start of your program. Adam |