<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:01 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-765] The com.mongodb.Mongo.close() method can return before the cleanup thread is finished</title>
                <link>https://jira.mongodb.org/browse/JAVA-765</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;just like bug java - 306&lt;/p&gt;

&lt;p&gt;Feb 19, 2013 10:23:20 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads&lt;br/&gt;
SEVERE: The web application &lt;span class=&quot;error&quot;&gt;&amp;#91;/webapps&amp;#93;&lt;/span&gt; appears to have started a thread named &lt;span class=&quot;error&quot;&gt;&amp;#91;MongoCleaner252742680&amp;#93;&lt;/span&gt; but has failed to stop it. This is very likely to create a memory leak.&lt;/p&gt;</description>
                <environment>Java driver : 2.8&lt;br/&gt;
Tomcat : 6.0.29&lt;br/&gt;
JDK : 6.0</environment>
        <key id="65941">JAVA-765</key>
            <summary>The com.mongodb.Mongo.close() method can return before the cleanup thread is finished</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="5">Cannot Reproduce</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="tomyangtw">Tom Yang</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Feb 2013 03:27:08 +0000</created>
                <updated>Tue, 25 Jun 2013 11:24:29 +0000</updated>
                            <resolved>Tue, 25 Jun 2013 11:24:29 +0000</resolved>
                                    <version>2.8.0</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="285337" author="jeff.yemin" created="Sat, 9 Mar 2013 22:28:59 +0000"  >&lt;p&gt;No, you have to code it manually by calling Mongo.close() on all Mongo instances.  That will close all the the sockets in the connection pool and stop all threads started by the Mongo constructor.&lt;/p&gt;</comment>
                            <comment id="272897" author="tomyangtw" created="Fri, 22 Feb 2013 08:16:58 +0000"  >&lt;p&gt;Thanks for the replication ,&lt;/p&gt;

&lt;p&gt;But I don&apos;t know how to close all Mongo connections at the same time .&lt;/p&gt;

&lt;p&gt;Is there any method could close all Mongo connections at the same time??&lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;


&lt;p&gt;2013/2/22 Jeff Yemin (JIRA) &amp;lt;jira@mongodb.org&amp;gt;&lt;/p&gt;
</comment>
                            <comment id="272741" author="jeff.yemin" created="Fri, 22 Feb 2013 03:01:25 +0000"  >&lt;p&gt;You can try posting more details of your application on the public forums.  But for one thing, I wouldn&apos;t think in a web application that you would be calling Mongo.close() in a finally block. More likely when the servlet context is destroyed.  See &lt;a href=&quot;http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html#contextDestroyed(javax.servlet.ServletContextEvent&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html#contextDestroyed(javax.servlet.ServletContextEvent&lt;/a&gt;), for example.&lt;/p&gt;
</comment>
                            <comment id="272705" author="tomyangtw" created="Fri, 22 Feb 2013 02:01:58 +0000"  >&lt;p&gt;Thank you for the replication ,&lt;/p&gt;

&lt;p&gt;I have one more question ,&lt;/p&gt;

&lt;p&gt;Is there any way can be sure MongoCleaner thread errors wouldn&apos;t happen&lt;br/&gt;
again ?&lt;/p&gt;

&lt;p&gt;I&apos;m sure I always add try/catch/finally to force to close mongo connection&lt;br/&gt;
, but it&apos;s still happened.&lt;/p&gt;

&lt;p&gt;thanks ~&lt;/p&gt;




&lt;p&gt;2013/2/21 Jeff Yemin (JIRA) &amp;lt;jira@mongodb.org&amp;gt;&lt;/p&gt;
</comment>
                            <comment id="272036" author="jeff.yemin" created="Thu, 21 Feb 2013 13:09:51 +0000"  >&lt;p&gt;I don&apos;t see any way that this could happen. The relevant code is here: &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/Mongo.java#L457&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/Mongo.java#L457&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It seems more likely that Mongo.close() was not called.  &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|hrma93:</customfieldvalue>

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