<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:21:23 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>[DRIVERS-383] Enable and configure TCP Keepalive by default</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-383</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;h5&gt;&lt;a name=&quot;ProblemDescription&quot;&gt;&lt;/a&gt;Problem Description&lt;/h5&gt;

&lt;p&gt;keepalive in the Java driver (and other drivers) is disabled by default. This leaves the possibility of leaving downed server connections in the middle of a socket read stuck in a waiting state.&lt;/p&gt;

&lt;p&gt;We had a situation where a mongos server crashed leaving 100 open connections on the client side. When we recovered the mongos the Java driver still had 100 bad connections taken from the pool and would not open new ones.&lt;/p&gt;

&lt;p&gt;As part of this change, drivers should include in their documentation a link to the &lt;a href=&quot;https://docs.mongodb.com/v3.2/faq/diagnostics/#does-tcp-keepalive-time-affect-mongodb-deployments&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MongoDB Diagnostics FAQ keepalive section&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;&lt;a name=&quot;Specification&quot;&gt;&lt;/a&gt;Specification&lt;/h5&gt;

&lt;ol&gt;
	&lt;li&gt;A driver MUST enable TCP keepalive by default.  This matches the behavior of the MongoDB server.&lt;/li&gt;
	&lt;li&gt;A driver MUST deprecate TCP keepalive-related options in the connection string (and any other way that it is configured), as there is no demonstrated benefit to allowing it to be disabled.  This also matches the behavior of the server.&lt;/li&gt;
	&lt;li&gt;A driver SHOULD set tcp_keepalive_time to 300 seconds unless it determines that the system default is already less than that. If the driver is unable to determine the system default at all it should not attempt to change it.  This matches the behavior of the server as well.&lt;/li&gt;
	&lt;li&gt;A driver SHOULD set tcp_keepalive_intvl to 10 seconds unless it determines that the system default is already less than that.   If the driver is unable to determine the system default at all it should not attempt to change it.  This is not the current behavior of the server, but if accepted here it will be recommended.  The reasoning is that with the default of 75 seconds for this value and a default of 9 probes, the actual time to failure is 300 + (75 * 9) = 975 sec = 16.25 minutes.  With a 10 second interval between probes it becomes a more reasonable 6.5 minutes.&lt;/li&gt;
	&lt;li&gt;A driver SHOULD set tcp_keepalive_cnt to 9 probes unless it determines that the system default is already less than that. If the driver is unable to determine the system default at all it should not attempt to change it.&lt;/li&gt;
	&lt;li&gt;A driver MUST document how keepalive-related options are configured.  Drivers that can set tcp_keepalive_time and tcp_keepalive_intvl to the values mandated above MUST document that they do so.  Drivers that can not MUST document that they do not and link to appropriate &lt;a href=&quot;https://docs.mongodb.com/manual/faq/diagnostics/#does-tcp-keepalive-time-affect-mongodb-deployments&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MongoDB Diagnostics FAQ keepalive section&lt;/a&gt; for instructions on setting these values at the system level.&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="384910">DRIVERS-383</key>
            <summary>Enable and configure TCP Keepalive by default</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="roy.rim@mongodb.com">Roy Rim</reporter>
                        <labels>
                            <label>newdriver</label>
                    </labels>
                <created>Thu, 18 May 2017 21:36:34 +0000</created>
                <updated>Fri, 12 May 2023 20:42:58 +0000</updated>
                            <resolved>Wed, 10 Jun 2020 14:35:39 +0000</resolved>
                                                                            <votes>5</votes>
                                    <watches>29</watches>
                                                                                                                <comments>
                            <comment id="2230581" author="behackett" created="Wed, 1 May 2019 15:21:17 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=charles.sarrazin&quot; class=&quot;user-hover&quot; rel=&quot;charles.sarrazin&quot;&gt;charles.sarrazin&lt;/a&gt; (and anyone else running into issues with Azure), you can change keepalive at the OS level. See &lt;a href=&quot;https://support.esri.com/en/technical-article/000006285&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://support.esri.com/en/technical-article/000006285&lt;/a&gt;. Note that the description above says &quot;A driver SHOULD set &amp;lt;setting&amp;gt; to &amp;lt;value&amp;gt; &lt;b&gt;unless it determines that the system default is already less than that&lt;/b&gt;. If the driver is unable to determine the system default at all it should not attempt to change it.&quot; So a driver won&apos;t override a smaller value already set at the OS level.&lt;/p&gt;
</comment>
                            <comment id="1841478" author="charles.sarrazin" created="Wed, 21 Mar 2018 23:58:36 +0000"  >&lt;p&gt;Wouldn&apos;t 120 be more sane for keep alive time? I&apos;m asking, as we recommend to set a keep-alive time of 120 for Azure deployments (due to the Azure load balancer killing connections after 240 seconds) in the production notes. And I did see issues for customers using the default keep-alive on Azure, for most tools (mongorestore w/ index creation, leading to a transparent drop of the connection, making the tool stall, no longer receiving responses queries issued to the server (index creation, as well as pending batches of inserts).&lt;/p&gt;</comment>
                            <comment id="1660659" author="jmikola@gmail.com" created="Wed, 30 Aug 2017 14:54:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sgupta%40vertmarkets.com&quot; class=&quot;user-hover&quot; rel=&quot;sgupta@vertmarkets.com&quot;&gt;sgupta@vertmarkets.com&lt;/a&gt;: Individual drivers are validated when their dependent ticket is resolved. In C#&apos;s case, this that ticket is &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1994&quot; title=&quot;Enable and configure TCP Keepalive by default&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1994&quot;&gt;&lt;del&gt;CSHARP-1994&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1660550" author="sgupta@vertmarkets.com" created="Wed, 30 Aug 2017 14:00:51 +0000"  >&lt;p&gt;I noticed that the c# driver is not included in the validation section. This is an issue for the c# driver as well. &lt;/p&gt;</comment>
                            <comment id="1648853" author="behackett" created="Tue, 15 Aug 2017 18:43:48 +0000"  >&lt;p&gt;Note that some Operating Systems don&apos;t implement getsockopt for options like TCP_KEEPIDLE (though you can set those options):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=52486&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=52486&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, macOS doesn&apos;t define TCP_KEEPIDLE. It defines TCP_KEEPALIVE (not to be confused with SO_KEEPALIVE!) for the same purpose.&lt;/p&gt;</comment>
                            <comment id="1579273" author="behackett" created="Wed, 24 May 2017 18:38:58 +0000"  >&lt;p&gt;That&apos;s a good point. I think we need a point 5 about documentation.&lt;/p&gt;</comment>
                            <comment id="1579257" author="jeff.yemin" created="Wed, 24 May 2017 18:27:23 +0000"  >&lt;p&gt;I can see warning if the equivalent of getsockopt/setsockopt actually fails.  I&apos;m less sure about warning for drivers in languages that don&apos;t even have the ability to call such methods at all (e.g. Java), as the warning would be logged in all circumstances.&lt;/p&gt;</comment>
                            <comment id="1579182" author="behackett" created="Wed, 24 May 2017 17:35:22 +0000"  >&lt;p&gt;Should the driver warn if it can&apos;t configure idle time or interval? &lt;/p&gt;</comment>
                            <comment id="1578675" author="jeff.yemin" created="Wed, 24 May 2017 10:16:02 +0000"  >&lt;p&gt;Proposed specification:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;A driver MUST enable TCP keepalive by default.  This matches the behavior of the MongoDB server.&lt;/li&gt;
	&lt;li&gt;A driver MUST deprecate TCP keepalive-related options in the connection string (and any other way that it is configured), as there is no demonstrated benefit to allowing it to be disabled.  This also matches the behavior of the server.&lt;/li&gt;
	&lt;li&gt;A driver SHOULD set tcp_keepalive_time to 300 seconds unless it determines that the system default is already less than that. If the driver is unable to determine the system default at all it should not attempt to change it.  This matches the behavior of the server as well.&lt;/li&gt;
	&lt;li&gt;A driver SHOULD set tcp_keepalive_intvl to 10 seconds unless it determines that the system default is already less than that.   If the driver is unable to determine the system default at all it should not attempt to change it.  This is not the current behavior of the server, but if accepted here it will be recommended.  The reasoning is that with the default of 75 seconds for this value and a default of 9 probes, the actual time to failure is 300 + (75 * 9) = 975 sec = 16.25 minutes.  With a 10 second interval between probes it becomes a more reasonable 6.5 minutes.&lt;/li&gt;
&lt;/ol&gt;



</comment>
                            <comment id="1578077" author="behackett" created="Tue, 23 May 2017 18:52:09 +0000"  >&lt;p&gt;We need solid documentation to go along with this. We should clearly document in the docs for each driver that idle time must be set appropriately at the OS level for both client and server, and recommend an appropriate value (the server docs recommend 300 seconds).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="387929">GODRIVER-37</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="486171">RUBY-1283</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="390754">CDRIVER-2176</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="390751">CSHARP-1994</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="390752">CXX-1363</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="390750">JAVA-2531</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="390747">NODE-1024</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="390753">PHPC-969</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="390748">PYTHON-1279</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="769132">RUST-170</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="369303">RUBY-1211</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="386283">SERVER-29341</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2340138">GODRIVER-2846</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="751481">RUBY-1799</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000X37A2IAJ, 500A000000X2WLdIAN]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_23952" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Driver Compliance</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<style type='text/css'>
         #scriptField, #scriptField *{
                border: 1px solid black;
            }

            #scriptField{
                border-collapse: collapse;
            }

            #scriptField td {
                text-align: center; /* Center-align text in table cells */
            }

            #scriptField td.key {
                text-align: left; /* Left-align text in the Key column */
            }

            #scriptField a {
                text-decoration: none; /* Remove underlines from links */
                border: none; /* Remove border from links */
            }
            
            /* Add green background color to cells with FixVersion */
            #scriptField td.hasFixVersion {
                background-color: #00FF00; /* Green color code */
            }

            /* Center-align the first row headers */
            #scriptField th {
                text-align: center;
            }
        </style>
<table id='scriptField'>
  <tr>
    <th>Key</th>
    <th>Status/Resolution</th>
    <th>FixVersion</th>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/NODE-1024'>NODE-1024</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>3.0.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-1279'>PYTHON-1279</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>3.5</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/SCALA-312'>SCALA-312</a>
    </td>
    <td>Works as Designed</td>
    <td class='hasFixVersion'>2.2.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-2531'>JAVA-2531</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>3.5.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-1994'>CSHARP-1994</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.7.1</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CXX-1363'>CXX-1363</a>
    </td>
    <td>Done</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPC-969'>PHPC-969</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>1.4.0-beta1, 1.4.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-2176'>CDRIVER-2176</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.8.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PERL-780'>PERL-780</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.1.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/GODRIVER-37'>GODRIVER-37</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>0.0.1</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-1283'>RUBY-1283</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.5.1</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUST-170'>RUST-170</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.1.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/SWIFT-485'>SWIFT-485</a>
    </td>
    <td>Works as Designed</td>
    <td class=''></td>
  </tr>
</table>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hszse7:</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>