<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:54:02 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>[JAVA-1202] Driver should dedicate a thread to monitor each server</title>
                <link>https://jira.mongodb.org/browse/JAVA-1202</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;In 2.12.0, the driver started using a ScheduledExecutorService to monitor the servers in MongoClient.  This service was initialized to use a number of threads equal to the size of the seed list given to MongoClient.  The idea was to reduce resource consumption by minimizing the number of background threads created by MongoClient, though this number could be increased using com.mongodb.MongoClientOptions.Builder#heartbeatThreadCount.  &lt;/p&gt;

&lt;p&gt;However, under some circumstances where servers are unavailable and take a significant amount of time to timeout on connect, this could result in starvation, and prevent the MongoClient from having enough free threads to monitor servers that are actually reachable and available.&lt;/p&gt;

&lt;p&gt;To fix this, we are going to change the design so that the client dedicates a single-threaded ScheduledExecutorService for each server being monitored.  This will eliminate the possibility of starvation, at the expense of slightly higher resource consumption.&lt;/p&gt;</description>
                <environment></environment>
        <key id="134789">JAVA-1202</key>
            <summary>Driver should dedicate a thread to monitor each server</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="jeff.yemin@mongodb.com">Jeffrey Yemin</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 May 2014 14:37:42 +0000</created>
                <updated>Tue, 31 Mar 2015 20:09:42 +0000</updated>
                            <resolved>Wed, 14 May 2014 18:07:38 +0000</resolved>
                                    <version>2.12.0</version>
                    <version>2.12.1</version>
                                    <fixVersion>2.12.2</fixVersion>
                    <fixVersion>3.0.0</fixVersion>
                                    <component>Cluster Management</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="869397" author="jeff.yemin" created="Tue, 31 Mar 2015 20:09:42 +0000"  >&lt;p&gt;Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.&lt;/p&gt;</comment>
                            <comment id="817734" author="xgen-internal-githook" created="Fri, 30 Jan 2015 18:38:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1202&quot; title=&quot;Driver should dedicate a thread to monitor each server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1202&quot;&gt;&lt;del&gt;JAVA-1202&lt;/del&gt;&lt;/a&gt;: Dedicate a single thread scheduled executor to each server being monitored&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/cf68a430452bc91dc5500750729f5b312fcb5885&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/cf68a430452bc91dc5500750729f5b312fcb5885&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="678688" author="xgen-internal-githook" created="Fri, 1 Aug 2014 14:36:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1202&quot; title=&quot;Driver should dedicate a thread to monitor each server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1202&quot;&gt;&lt;del&gt;JAVA-1202&lt;/del&gt;&lt;/a&gt;: Made connection volatile to remove race condition, and removed isRunning, since the executor is single threaded anyway.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/65e8e30930f542ebd0b2e10667ee8b8351dc03e5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/65e8e30930f542ebd0b2e10667ee8b8351dc03e5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="678687" author="xgen-internal-githook" created="Fri, 1 Aug 2014 14:36:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1202&quot; title=&quot;Driver should dedicate a thread to monitor each server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1202&quot;&gt;&lt;del&gt;JAVA-1202&lt;/del&gt;&lt;/a&gt;: Dedicate a single thread scheduled executor to each server being monitored, and , when changing the heartbeat frequency, ensure that the ServerStateNotifier is scheduled at most once by cancelling the existing schedule before creating the new one.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/7d59cc8217eb6f60b238df98499ea4005ad430ee&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/7d59cc8217eb6f60b238df98499ea4005ad430ee&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="632728" author="xgen-internal-githook" created="Tue, 24 Jun 2014 16:29:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1202&quot; title=&quot;Driver should dedicate a thread to monitor each server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1202&quot;&gt;&lt;del&gt;JAVA-1202&lt;/del&gt;&lt;/a&gt;: Dedicate a single thread scheduled executor to each server being monitored&lt;br/&gt;
Branch: 3.0.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/cf68a430452bc91dc5500750729f5b312fcb5885&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/cf68a430452bc91dc5500750729f5b312fcb5885&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="575504" author="xgen-internal-githook" created="Wed, 7 May 2014 14:21:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1202&quot; title=&quot;Driver should dedicate a thread to monitor each server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1202&quot;&gt;&lt;del&gt;JAVA-1202&lt;/del&gt;&lt;/a&gt;: Made connection volatile to remove race condition, and removed isRunning, since the executor is single threaded anyway.&lt;br/&gt;
Branch: 2.12.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/65e8e30930f542ebd0b2e10667ee8b8351dc03e5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/65e8e30930f542ebd0b2e10667ee8b8351dc03e5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="574102" author="xgen-internal-githook" created="Tue, 6 May 2014 11:13:16 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1202&quot; title=&quot;Driver should dedicate a thread to monitor each server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1202&quot;&gt;&lt;del&gt;JAVA-1202&lt;/del&gt;&lt;/a&gt;: Dedicate a single thread scheduled executor to each server being monitored, and , when changing the heartbeat frequency, ensure that the ServerStateNotifier is scheduled at most once by cancelling the existing schedule before creating the new one.&lt;br/&gt;
Branch: 2.12.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/7d59cc8217eb6f60b238df98499ea4005ad430ee&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/7d59cc8217eb6f60b238df98499ea4005ad430ee&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </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|hrg9b3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8413</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="161">Sprint 2 - May 5 - May 23</customfieldvalue>

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