<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:54 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-712] Disassociate connections from dead threads</title>
                <link>https://jira.mongodb.org/browse/JAVA-712</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Monitor/check if a thread is gone and if so, disassociate the thread from the connection (socket/port) so it can be used by any thread and no longer has affinity.&lt;/p&gt;</description>
                <environment></environment>
        <key id="58772">JAVA-712</key>
            <summary>Disassociate connections from dead threads</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="scotthernandez">Scott Hernandez</reporter>
                        <labels>
                    </labels>
                <created>Sun, 9 Dec 2012 15:00:39 +0000</created>
                <updated>Tue, 25 Jun 2013 04:06:48 +0000</updated>
                            <resolved>Tue, 25 Jun 2013 04:06:48 +0000</resolved>
                                                                    <component>Connection Management</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="366998" author="jeff.yemin" created="Tue, 25 Jun 2013 04:06:48 +0000"  >&lt;p&gt;Thread affinity is being removed entirely in 3.0.&lt;/p&gt;</comment>
                            <comment id="210674" author="jeff.yemin" created="Mon, 10 Dec 2012 02:41:20 +0000"  >&lt;p&gt;If you set max pool size to n, then you expect to need n concurrent connections at some point.  So eventually your application will get to the max pool size, in which case disassociating won&apos;t really matter, as you&apos;re already at the max, and new threads will eventually steal all the connections with affinity to the dead ones.&lt;/p&gt;

&lt;p&gt;If you want more re-use and don&apos;t actually expect to need that many connections concurrently, you can set the pool size smaller.&lt;/p&gt;

&lt;p&gt;If you&apos;re write concern is ACKNOWLEDGED, what does thread affinity buy you?  And if it&apos;s UNACKNOWLEDGED, things can work the way you expect during testing, and differently under high load when threads start stealing each other&apos;s connections.&lt;/p&gt;</comment>
                            <comment id="210611" author="scotthernandez" created="Mon, 10 Dec 2012 00:47:18 +0000"  >&lt;p&gt;Yes, there are some issues at high contention, but less so if you use a WriteConcern like the MongoClient does by default now. It gets a little more hairy with mongos, and non-primary reads, but that is another issue and not something that getting rid of thread affinity will fix (completely).&lt;/p&gt;

&lt;p&gt;Not sure how this is more of an issue with maxIdleTimeMS (which is what I assume you meant instead of min).&lt;/p&gt;

&lt;p&gt;The basic problem is that the current impl. will create a connection before it reuses one (if you are under the max pool size).&lt;/p&gt;

&lt;p&gt;The use-case is if you create new threads to do your work then connections will not get reused until the pool has filled; if we add this support then when the thread dies the socket will be avail for use before the pool is full. &lt;/p&gt;</comment>
                            <comment id="210525" author="jeff.yemin" created="Sun, 9 Dec 2012 21:56:38 +0000"  >&lt;p&gt;It would be safer to get rid of thread affinity altogether.  Thread affinity can lead to unexpected results when running under load.  &lt;/p&gt;

&lt;p&gt;The way it is now, a connection with established affinity will already be stolen by another thread if there is any contention in the pool (pool size &amp;lt; thread size).  &lt;/p&gt;

&lt;p&gt;This becomes a bigger issue if we implement minIdleTimeMS, as thread affinity can artificially decrease idle time.&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|hrkzfb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>36217</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>