<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:01: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-1208] Timeout 10s for queries when shutting down one server of replicaset</title>
                <link>https://jira.mongodb.org/browse/CXX-1208</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;I have replicaset with several servers and when I shut down one of secondary server I&apos;ve got timeout of read queries 10 seconds. Client has default read_preference (as far as I know it&apos;s read from primary). Why driver wait for secondary when its not needed by settings?&lt;/p&gt;</description>
                <environment>Linux, Debian 8, C driver 1.5.3</environment>
        <key id="350010">CXX-1208</key>
            <summary>Timeout 10s for queries when shutting down one server of replicaset</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="denbip">Denis Bip</reporter>
                        <labels>
                    </labels>
                <created>Sat, 28 Jan 2017 14:39:18 +0000</created>
                <updated>Fri, 27 Oct 2023 13:13:47 +0000</updated>
                            <resolved>Sat, 28 Jan 2017 22:47:30 +0000</resolved>
                                    <version>3.1.1</version>
                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1487593" author="david.golden" created="Sat, 28 Jan 2017 22:47:30 +0000"  >&lt;p&gt;I&apos;m going to close this ticket, as you&apos;ve got the workaround you need, but feel free to ask more questions even after it&apos;s closed if you&apos;d like.&lt;/p&gt;</comment>
                            <comment id="1487592" author="david.golden" created="Sat, 28 Jan 2017 22:46:09 +0000"  >&lt;p&gt;Here&apos;s a blog post with the gory details: &lt;a href=&quot;https://www.mongodb.com/blog/post/server-discovery-and-monitoring-next-generation-mongodb-drivers&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Server Discovery and Monitoring In Next Generation MongoDB Drivers&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1487572" author="denbip" created="Sat, 28 Jan 2017 21:06:22 +0000"  >&lt;p&gt;Thank you very much for explain! Now I understand how it works, if you can give me more information on Monday - that will be very nice, thanks)&lt;/p&gt;</comment>
                            <comment id="1487564" author="david.golden" created="Sat, 28 Jan 2017 20:54:23 +0000"  >&lt;p&gt;I&apos;m happy to explain more on Monday if you&apos;d like, but briefly so you don&apos;t spend too much time on this:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;mongocxx::client&lt;/tt&gt; is single-threaded, and scans all servers at startup and once a minute.  The 10 seconds you&apos;re seeing is the connection timeout on the socket to the down server.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;mongocxx::pool&lt;/tt&gt; is multi-threaded, and maintains a thread per server in the background to do continuous monitoring.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;For replica sets, unless you&apos;re in an extremely resource limited environment, pool is the best choice.  We have some tickets to make this more explicit in our documentation.&lt;/p&gt;</comment>
                            <comment id="1487559" author="denbip" created="Sat, 28 Jan 2017 20:37:43 +0000"  >&lt;p&gt;With mongocxx::pool the problem seems to go away, but interesting that mongocxx::client works with delay even I block client-server ip at one of Arbiter-server...continue testing...&lt;/p&gt;</comment>
                            <comment id="1487505" author="denbip" created="Sat, 28 Jan 2017 14:54:45 +0000"  >&lt;p&gt;I&apos;m using mongocxx::client. In short it&apos;s very simple code, like in examples, just create client and do the query (aggregate with mongocxx::pipeline)&lt;/p&gt;</comment>
                            <comment id="1487504" author="david.golden" created="Sat, 28 Jan 2017 14:47:22 +0000"  >&lt;p&gt;Hi.  It would be really helpful if you could give us an &lt;a href=&quot;http://sscce.org&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;SSCCE&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Regardless, my first diagnostic question is whether you&apos;re using &lt;tt&gt;mongocxx::client&lt;/tt&gt; or &lt;tt&gt;mongocxx::pool&lt;/tt&gt;?  In pretty much any non-toy case (i.e. with a replica set), you should be using the pool.&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|hsudtz:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>