<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:14:24 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>[CDRIVER-2172] Call &quot;ping&quot; on a socket that has been idle for socketCheckIntervalMS</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2172</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Similar to &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2075&quot; title=&quot;Retry ismaster calls once&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2075&quot;&gt;&lt;del&gt;CDRIVER-2075&lt;/del&gt;&lt;/a&gt; (retry &lt;tt&gt;isMaster&lt;/tt&gt; calls once), I think it may be worthwhile if &lt;tt&gt;_mongoc_cluster_check_interval()&lt;/tt&gt; made one attempt to reestablish a closed stream before returning an error.&lt;/p&gt;

&lt;p&gt;Using the basic case of a standalone topology as an example, I created a basic PHP script that connects to localhost:27017 and issues a ping command and served this through a single-worker web server to isolate our libmongoc client persistence to all requests. When I restarted the mongod server between requests (within the span of two seconds), the socket is left in the &lt;tt&gt;CLOSE_WAIT&lt;/tt&gt; state and the subsequent request encounters a &quot;Stream is closed&quot; error.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#socketcheckintervalms&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;socketCheckIntervalMS&lt;/tt&gt;&lt;/a&gt; does not seem relevant here, as the &lt;tt&gt;_mongoc_cluster_check_interval()&lt;/tt&gt; will return a &quot;Stream is closed&quot; error before deciding if &lt;tt&gt;socketCheckIntervalMS&lt;/tt&gt; warrants an &lt;tt&gt;isMaster&lt;/tt&gt; command.&lt;/p&gt;

&lt;p&gt;The original test used our default server selection (&lt;tt&gt;serverSelectionTryOnce=true&lt;/tt&gt;). When I switched to &lt;tt&gt;serverSelectionTryOnce=false&lt;/tt&gt;, I did not notice any change in behavior. Is that by design, since libmongoc has technically left the server selection loop at this point? If that is the case, I think it supports the idea of retrying connections in this case.&lt;/p&gt;

&lt;p&gt;I did notice that tuning &lt;tt&gt;heartbeatFrequencyMS&lt;/tt&gt; lower to ensure a topology update between restarting mongod and the subsequent PHP request did avoid a &quot;Stream is closed&quot; error being reported to the user.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Note: if this issue is worth implementing, we should probably also revise the SDAM spec accordingly. I can create that ticket if needed.&lt;/p&gt;</description>
                <environment></environment>
        <key id="389123">CDRIVER-2172</key>
            <summary>Call &quot;ping&quot; on a socket that has been idle for socketCheckIntervalMS</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="13201">Fixed</resolution>
                                        <assignee username="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jun 2017 14:25:31 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:39 +0000</updated>
                            <resolved>Fri, 16 Jun 2017 20:03:05 +0000</resolved>
                                                    <fixVersion>1.7.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1599633" author="xgen-internal-githook" created="Fri, 16 Jun 2017 20:03:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2172&quot; title=&quot;Call &amp;quot;ping&amp;quot; on a socket that has been idle for socketCheckIntervalMS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2172&quot;&gt;&lt;del&gt;CDRIVER-2172&lt;/del&gt;&lt;/a&gt; check idle socket with &quot;ping&quot;&lt;/p&gt;

&lt;p&gt;Server Selection Spec update for single-threaded drivers.&lt;/p&gt;

&lt;p&gt;If a server is selected that has an existing connection that has been idle for&lt;br/&gt;
socketCheckIntervalMS, the driver MUST check the connection with the &quot;ping&quot;&lt;br/&gt;
command. If the ping succeeds, use the selected connection. If not, set the&lt;br/&gt;
server&apos;s type to Unknown and update the Topology Description according to the&lt;br/&gt;
Server Discovery and Monitoring Spec, and attempt once more to select a server.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/9f9934dcd9d7de3e7f8db315145106df44edee23&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/9f9934dcd9d7de3e7f8db315145106df44edee23&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1597206" author="jesse" created="Wed, 14 Jun 2017 20:06:39 +0000"  >&lt;p&gt;We&apos;ve updated the specs:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/specifications/commit/4369d5667b663ab07b2928ad04fdec1b56b6c20f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/commit/4369d5667b663ab07b2928ad04fdec1b56b6c20f&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What the driver should do is re-check an idle socket right after server selection. If a server is selected that has an existing connection that&apos;s been idle for 5 seconds, the driver should attempt to call &quot;ping&quot;, not ismaster, since we&apos;re not trying to update the topology. If &quot;ping&quot; succeeds, use the socket. If it failed, set the server&apos;s type to Unknown and re-enter server selection once, re-discovering the topology if needed (as SDAM already specifies), then proceed from there.&lt;/p&gt;</comment>
                            <comment id="1593596" author="xgen-internal-githook" created="Fri, 9 Jun 2017 22:54:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2172&quot; title=&quot;Call &amp;quot;ping&amp;quot; on a socket that has been idle for socketCheckIntervalMS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2172&quot;&gt;&lt;del&gt;CDRIVER-2172&lt;/del&gt;&lt;/a&gt; robust mongoc_client_server_select&lt;/p&gt;

&lt;p&gt;If a server is selected and its socket has not been used in 5 seconds,&lt;br/&gt;
check if the socket is still good and retry once if not.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/3f1a09b8d1c277df0b7efb79c5fc2acb03bf0d3b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/3f1a09b8d1c277df0b7efb79c5fc2acb03bf0d3b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1593458" author="jesse" created="Fri, 9 Jun 2017 20:52:19 +0000"  >&lt;p&gt;I&apos;m reopening this. Depending on how the related Server Discovery And Monitoring Spec change is resolved, this may require more work. At the very least, the logic should move from mongoc_client_select_server into mongoc_topology_select_server so that all single-threaded code paths benefit from the change, not just one function.&lt;/p&gt;</comment>
                            <comment id="1589126" author="jesse" created="Tue, 6 Jun 2017 21:19:22 +0000"  >&lt;p&gt;The PHP driver uses the C driver like:&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;server = mongoc_client_select_server (...);&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;do_something_with (server);&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;The best solution I can think of to make the above logic more resilient is to update mongoc_client_select_server:&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;for (i = 0; i &amp;lt; 2; i++) {&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;    sd = topology_select_server(...);&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 (single_threaded) {&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;        node = mongoc_topology_scanner_get_node (...);&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 (node &amp;amp;&amp;amp; node is over 5 seconds old) {&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;            call ismaster&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 (error) {&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;              continue;&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;            }&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;        }&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;    }&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 sd;&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;}&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;&amp;nbsp;&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;return NULL;&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;Additionally, there&apos;s logic in mongoc_cluster_sendv_to_server to check a 1-second-old socket to see if it&apos;s closed (which is not in any spec), and check a 5-second-old socket with an ismaster (a misinterpretation of SDAM). If either check fails then mongoc_cluster_sendv_to_server returns an error, which is useless. Remove those checks from mongoc_cluster_sendv_to_server.&lt;/p&gt;</comment>
                            <comment id="1588949" author="jmikola@gmail.com" created="Tue, 6 Jun 2017 19:14:03 +0000"  >&lt;blockquote&gt;&lt;p&gt;Is that by design, since libmongoc has technically left the server selection loop at this point? If that is the case, I think it supports the idea of retrying connections in this case.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This may be problematic if the connection was dropped as a result a replica set failover, where a primary has stepped down to become a secondary. In that case, libmongoc thinks it has selected a primary (based on the last topology state) and after reconnecting it may be a secondary. In this case, we don&apos;t want to return a socket for a secondary and should instead report an error.&lt;/p&gt;</comment>
                            <comment id="1584871" author="jmikola@gmail.com" created="Thu, 1 Jun 2017 14:40:12 +0000"  >&lt;p&gt;Another observation: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2075&quot; title=&quot;Retry ismaster calls once&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2075&quot;&gt;&lt;del&gt;CDRIVER-2075&lt;/del&gt;&lt;/a&gt; would allow libmongoc to recover from a dropped connection, which it does not become aware of until &lt;tt&gt;isMaster&lt;/tt&gt; fails. In that case, &lt;tt&gt;mongoc_socket_check_closed()&lt;/tt&gt; has failed to detect that the socket was dropped. In the OP, I&apos;m describing a case where we close a connection between two ports on the local machine, so the OS is always aware that one side has dropped the connection and sets the state as &lt;tt&gt;CLOSE_WAIT&lt;/tt&gt;. Given that, &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2075&quot; title=&quot;Retry ismaster calls once&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2075&quot;&gt;&lt;del&gt;CDRIVER-2075&lt;/del&gt;&lt;/a&gt; and this issue may be two sides of the same coin.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="393961">DRIVERS-390</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="631400">PHPC-1296</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="389643">CDRIVER-2174</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="359970">CDRIVER-2075</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|ht0g1j:</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>