<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:12 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-400] ReplicaSetStatus does not interrupt the Updater thread on close</title>
                <link>https://jira.mongodb.org/browse/JAVA-400</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;com.mongodb.ReplicaSetStatus.Updater thread should be interrupted and closed gracefully upon Mongo.close() call. I know it&apos;s a daemon thread, but in Tomcat, when redeploying I get:&lt;/p&gt;

&lt;p&gt;SEVERE: The web application &lt;span class=&quot;error&quot;&gt;&amp;#91;/ssp&amp;#93;&lt;/span&gt; appears to have started a thread named &lt;span class=&quot;error&quot;&gt;&amp;#91;ReplicaSetStatus:Updater&amp;#93;&lt;/span&gt; but has failed to stop it. This is very likely to create a memory leak.&lt;/p&gt;

&lt;p&gt;Also see: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-191&quot; title=&quot; Possible leak in Java 2.2 Driver with ReplicaSetStatus$Updater &quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-191&quot;&gt;&lt;del&gt;JAVA-191&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="20086">JAVA-400</key>
            <summary>ReplicaSetStatus does not interrupt the Updater thread on close</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="9">Done</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="nurkiewicz">Tomasz Nurkiewicz</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Jul 2011 12:28:09 +0000</created>
                <updated>Mon, 18 Jun 2012 19:36:09 +0000</updated>
                            <resolved>Thu, 5 Apr 2012 18:11:30 +0000</resolved>
                                    <version>2.6.3</version>
                                    <fixVersion>2.8.0</fixVersion>
                                    <component>Cluster Management</component>
                                        <votes>1</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="134046" author="jeff.yemin" created="Mon, 18 Jun 2012 19:36:09 +0000"  >&lt;p&gt;Closing for 2.8.0 release.&lt;/p&gt;</comment>
                            <comment id="97518" author="jeff.yemin" created="Sat, 10 Mar 2012 16:56:25 +0000"  >&lt;p&gt;I fixed this in the context of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-458&quot; title=&quot;with slaveOk, query distribution to slave is not even&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-458&quot;&gt;&lt;del&gt;JAVA-458&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="47080" author="markustripp" created="Mon, 8 Aug 2011 16:57:31 +0000"  >&lt;p&gt;When you execute Mongo.close() this triggers ReplicaSetStatus.close() which updates the _close variable.&lt;/p&gt;

&lt;p&gt;Unfortunately the ReplicaSetStatus Updater Thread sleeps for up to 5 sec. until it checks the _close variable again. In this time Tomcat already undeployed and deployed the application and detected the potential memory leak problems. You can easily verify this if you close Mongo and sleep for &amp;gt; 5 sec. in the destroy method of your Servlet. Then you won&apos;t experience the problem. But this is not a good workaround.&lt;/p&gt;

&lt;p&gt;Better would be if the ReplicaSetStatus.close method interrupts the sleeping Thread so that it immediately closes safely. The problem is that the Tomcat classloader cannot cleanup correctly which results in a growth of the PermGen memory region, which in the end can result in an OutOfMemoryError.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="24075">JAVA-458</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhbv3:</customfieldvalue>

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