<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:00:46 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CXX-912] The logic of func DBClientReplicaSet::isFailed() in dbclient_rs.h</title>
                <link>https://jira.mongodb.org/browse/CXX-912</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Hi! I am using DBClientReplicaSet to querying a mongodb replicaset, and I found a bug in this class. In my project, I use client connection as a long keep alive connection. And everytime I reuse this client again, I must check this client whether it is ok. So I use func DBClientReplicaSet::isFailed() to check the client whether it is ok or not. But I found it always return true. I check the code below in dbclient_rs.h&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;thead&gt;
			&lt;tr id=&quot;syntaxplugin_title&quot;&gt;
			&lt;td bgcolor=&quot;#f5f5f5&quot; style=&quot;font-family: Arial,sans-serif; color: #333; border-bottom: 1px solid #bbb; background-color: #f5f5f5 !important; font-weight: bold; line-height: 1em;&quot; &gt;
				&lt;p style=&quot;margin: 5px 10px; padding: 0;&quot;&gt;dbclient_rs.h&lt;/p&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/thead&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    virtual bool isFailed() const {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        return !_master || _master-&amp;gt;isFailed();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    }   &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;In my project, I always query mongodb with the secondary node using the method DBClientReplicaSet::slaveConn(), so the client did not have the chance to init the _master member.&lt;br/&gt;
I think in method isFailed(), not only must we check the _master member, but also the _lastSlaveOkConn member. If one of the two member&apos;s status is OK, the method should return true.&lt;br/&gt;
If you think it indeed a bug, I will commit a bug fix later.&lt;/p&gt;

&lt;p&gt;thanks.&lt;/p&gt;</description>
                <environment></environment>
        <key id="287451">CXX-912</key>
            <summary>The logic of func DBClientReplicaSet::isFailed() in dbclient_rs.h</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="andrew.morrow@mongodb.com">Andrew Morrow</assignee>
                                    <reporter username="unpeeled_onion@outlook.com">ethan zhang</reporter>
                        <labels>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Wed, 18 May 2016 07:02:02 +0000</created>
                <updated>Wed, 25 May 2016 14:57:33 +0000</updated>
                            <resolved>Wed, 25 May 2016 12:42:45 +0000</resolved>
                                    <version>legacy-1.1.0</version>
                    <version>legacy-1.1.1</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1273322" author="acm" created="Tue, 24 May 2016 13:30:15 +0000"  >&lt;p&gt;Hi -&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;If you want to communicate with a secondary, the correct way to do so is to set a &lt;a href=&quot;https://docs.mongodb.com/manual/core/read-preference/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;read preference&lt;/a&gt; in your &lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/blob/legacy-1.1.1/src/mongo/client/dbclientinterface.h#L403-L542&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Query&lt;/a&gt; by passing it an object of type &lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/blob/legacy-1.1.1/src/mongo/client/dbclientinterface.h#L123-L153&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongo::ReadPreference&lt;/a&gt;. This will cause DBClientReplicaSet to &lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/blob/legacy-1.1.1/src/mongo/client/dbclient_rs.cpp#L522-L575&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;route your query appropriately&lt;/a&gt;, since not all commands are actually valid to run on a secondary. None of the above requires that you use the DBClientReplicaSet interface. The DBClientReplicaSet type should be considered an internal implementation detail of the driver.&lt;/li&gt;
	&lt;li&gt;The 26compat driver (which is even older than the legacy driver) does have a connection pool, and it &lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/blob/26compat/src/mongo/client/connpool.cpp#L46&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;uses isFailed when deciding whether a connection is valid while returning to the pool&lt;/a&gt;. In fact, my expectation is that the isFailed method was implemented as it is to explicitly support the semantics of the old connection pool, whatever those were. That said, do you actually need a global pool? Do you ever need more than one connection in any given thread? Perhaps you would do better to use per-thread connections via a thread-specific variable.&lt;/li&gt;
	&lt;li&gt;Sure, if isFailed has the semantics you want, then use it. But my assertion is that your observed effect, that _master is never set so the function always returns true, is a side effect of the fact that you are mis-using the class by directly manipulating it. If, instead, you achieve your intended goal via the DBClientBase interface and use the read preference facility as designed, the implementation details of DBClientReplicaSet and the ReplicaSetMonitor will render the isFailed method meaningful.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Please understand that the Legacy C++ driver is just that  - legacy. It is headed for end-of-life in the near future. It is very unlikely to support any new MongoDB features after those features incorporated in the lergacy-1.1.0 release to support MongoDB 3.2. The arguments in favor of making any change must be extraordinarily compelling: the driver has a wide install base that relies on its existing semantics (whatever those are and however broken they may be), so changing those semantics in a stable release is very risky, and we also have new stable drivers in C and C&amp;#43;&amp;#43;11 that offer much better APIs with unified semantics and high quality implementations. The legacy C&amp;#43;&amp;#43; driver has none of these things. &lt;/p&gt;

&lt;p&gt;If you want a stable driver with proper semantics, continued support, and which will reflect ongoing development in MongoDB server releases, you should use either the MongoDB C driver, or the new C&amp;#43;&amp;#43;11 driver.&lt;/p&gt;</comment>
                            <comment id="1273171" author="unpeeled_onion@outlook.com" created="Tue, 24 May 2016 11:13:53 +0000"  >&lt;ul&gt;
	&lt;li&gt;First, Only use the API exposed as DBClientBase is not enough. For example, the slaveConn() method in the DBClientReplicaSet class. If we want to query a mongodb replicaset cluster through a secondary, We must use slaveConn() method which was not in the DBClientBase API. Besides, I think all public method in the DBClientReplicaSet class should have be Open API.&lt;/li&gt;
	&lt;li&gt;Second, I use isFailed() because I have try writing a connection pool in my project. Every time we release the connection back to the connection pool, we must check the connection is still OK, so I called the isFailed() method. If the connection is a DBClientBase instance, everything is OK. But if the connection is a DBClientReplicaSet instance, sometimes it goes wrong. Because isFailed() implemented by DBClientReplicaSet only check the connection to the master node in Mongodb replica set. However, in DBClientReplicaSet instance there have two member of connections, one was a connection to the master node, the other is a connection to the secondary node. So, if the DBClientReplicaSet instance only have a connection to the secondary node, it will failed, but as a fact, the connection is still OK. Would you please &lt;b&gt;read the driver code&lt;/b&gt; again, I think it will be more clear.&lt;/li&gt;
	&lt;li&gt;Third, in your opinion above, you suggest using isStillConnected() instead. But again &lt;b&gt;read&lt;/b&gt; the code, you will find that isStillConnected() method will retry connect the connection which the DBClientReplicaSet instance handled, and isFailed() only check the connection handled by the DBClientReplicaSet instance is still OK. That is what we needed. We only need to check the connection is still OK, but not reconnection it.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Andrew, If you really want to close this issue, please do have someone else have read this issue first, Thankx.&lt;/p&gt;</comment>
                            <comment id="1271193" author="acm" created="Sun, 22 May 2016 17:53:37 +0000"  >&lt;p&gt;Several comments:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;You should not be making direct calls to the concrete class DBClientReplicaSet. Instead, just use the API exposed as DBClientBase. Internally, the DBClientConnection and DBClientReplicaSet classes will do the right things.&lt;/li&gt;
	&lt;li&gt;You haven&apos;t really explained why you need to call isFailed. What question are you trying to answer or state are you trying to discover? If the driver is functioning properly, and you are connected to a replica set, your DBClientBase object will automatically follow the master, and it will properly route operations based on read preference. It is important to note that individual operations may fail, and the driver does not retry.&lt;/li&gt;
	&lt;li&gt;It is also important to keep in mind that since we are working with a distributed system, even if you call a function to observe the state now (like isFailed or isConnected), you can&apos;t rely on that state still being true when you try to use the connection. In other words:&lt;/li&gt;
&lt;/ul&gt;


&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;auto conn = connStr.connect(...);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;if (conn-&amp;gt;isStillConnected()) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    // This still might fail - we could have become non-connected after checking but before running the command.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    conn-&amp;gt;runCommand(...);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Alternatively, writing it with isFailed:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;auto conn = connStr.connect(...);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;if (!conn-&amp;gt;isFailed()) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    // This still might fail - we could have become failed after checking but before running the command.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    conn-&amp;gt;runCommand(...);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;From the perspective of the driver maintainer, there is no documentation for the isFailed function, so its intended semantics are unclear. It is possible that the implementation for DBClientReplicaSet is in fact broken. However, I&apos;m reluctant to change it at this point - the driver is stable, and whatever semantics that function has had, it has had for a long time. Changing it risks breaking those semantics in the case that the function is being used in the wild, no matter how odd the semantics or misguided such usage may be.&lt;/p&gt;

&lt;p&gt;So, I&apos;m inclined to close this ticket as Wont Fix, but please let me know if you have any additional comments or questions. If you do disagree with the above analysis, it would be very helpful if you could post some code showing how you are connecting to the server, and how and why you are using isFailed.&lt;/p&gt;</comment>
                            <comment id="1269789" author="unpeeled_onion@outlook.com" created="Fri, 20 May 2016 07:26:33 +0000"  >&lt;p&gt;Hi, Andrew.&lt;br/&gt;
I use old legacy driver because many many project in my team using the legacy-26compat driver. Recently, we are starting to update out mongodb version up to 3.0, so we have made some test with legacy driver which compatible with the 26compat driver.&lt;br/&gt;
The way you mentation to connect to a replica set was just I used in my test code.&lt;br/&gt;
My only question is the isFailed() method in the class DBClientReplicaSet&#65292;which will always return false even if the client has connected with the a secondary mongodb node.&lt;br/&gt;
So, I think it is a bug when using this method. It only check the connection with the primary node but missing the secondary node.&lt;/p&gt;

&lt;p&gt;Is it not welcomed to fix some some bugs with the old legacy driver in the mongodb community? I wish to fix the bugs in the driver, so that other develop will not be face the same question.&lt;/p&gt;

&lt;p&gt;My English written is not so much, So Which part is not clear please point to me~&lt;/p&gt;</comment>
                            <comment id="1267479" author="acm" created="Wed, 18 May 2016 12:52:35 +0000"  >&lt;p&gt;You should not be making direct use of the DBClientReplicaSet class. Instead, the correct way to connect to a replica set is via the following procedure:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    const std::string URI = // some mongodb URI&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    ConnectionString connStr = ConnectionString::parse(URI);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    std::string errorMessage;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    DBClientBase* conn = connStr.connect(&amp;amp;errorMessage);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Could you please try connecting this way, via ConnectionString::parse and ConnectionString::connect?&lt;/p&gt;

&lt;p&gt;Also, is there a particular reason you are using the old legacy driver? I can&apos;t recommend strongly enough that you switch to the new C++11 driver if at all possible. It offers a greatly improved API and much higher quality of implementation.&lt;/p&gt;
</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hslgtb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1063">Platforms 15 (06/03/16)</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>