<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:22 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-915] ConnectionWaitTImeout thrown after upgrading driver</title>
                <link>https://jira.mongodb.org/browse/JAVA-915</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Upgrading from 2.10 to 2.11 the (request and db-intense) web app fails after about two days with the following exception:&lt;/p&gt;

&lt;p&gt;Connection wait timeout after 120000 ms. Stacktrace follows:&lt;br/&gt;
com.mongodb.DBPortPool$ConnectionWaitTimeOut: Connection wait timeout after 120000 ms&lt;/p&gt;

&lt;p&gt;No code change, only upgraded MongoDB.&lt;/p&gt;

&lt;p&gt;Is there anything we&apos;ve to change when upgrading from 2.10 to 2.11?&lt;/p&gt;

&lt;p&gt;See other reporters at the Grails MongoDB issue &lt;a href=&quot;http://jira.grails.org/browse/GPMONGODB-307&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://jira.grails.org/browse/GPMONGODB-307&lt;/a&gt; - this is however NOT RELATED TO THE GRAILS PLUGIN (see my comment in that issue)&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;</description>
                <environment>Ubuntu 12.04 LTS 64-bit Java 7 Oracle JDK</environment>
        <key id="84358">JAVA-915</key>
            <summary>ConnectionWaitTImeout thrown after upgrading driver</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="fabiangebert">Fabian Gebert</reporter>
                        <labels>
                            <label>regression</label>
                    </labels>
                <created>Thu, 1 Aug 2013 16:58:31 +0000</created>
                <updated>Wed, 2 Oct 2013 06:57:54 +0000</updated>
                            <resolved>Fri, 16 Aug 2013 16:09:27 +0000</resolved>
                                    <version>2.11.2</version>
                                                    <component>API</component>
                                        <votes>3</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="434436" author="grocher" created="Wed, 2 Oct 2013 06:57:54 +0000"  >&lt;p&gt;As I mentioned in &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-853&quot; title=&quot;Client runs out of connections with nested calls to DB.requestStart&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-853&quot;&gt;&lt;del&gt;JAVA-853&lt;/del&gt;&lt;/a&gt;. This is still an issue in 2.11.3 and the root cause of &lt;a href=&quot;http://jira.grails.org/browse/GPMONGODB-307&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://jira.grails.org/browse/GPMONGODB-307&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Only downgrading to an older version of the driver fixes the problem. Can someone please reopen and address this issue?&lt;/p&gt;</comment>
                            <comment id="404738" author="noamt" created="Fri, 16 Aug 2013 16:45:55 +0000"  >&lt;p&gt;That&apos;s great, thanks!&lt;/p&gt;</comment>
                            <comment id="404704" author="jeff.yemin" created="Fri, 16 Aug 2013 16:08:19 +0000"  >&lt;p&gt;Now that we know the root cause, I see this is a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-853&quot; title=&quot;Client runs out of connections with nested calls to DB.requestStart&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-853&quot;&gt;&lt;del&gt;JAVA-853&lt;/del&gt;&lt;/a&gt;.  I&apos;m going to resolve this one, and link it&lt;/p&gt;</comment>
                            <comment id="399988" author="fabiangebert" created="Sat, 10 Aug 2013 05:50:26 +0000"  >&lt;p&gt;I don&apos;t explicitly use mongo session, but I guess when using GORM, it will automatically be used.&lt;br/&gt;
So you think it can be fixed?&lt;/p&gt;</comment>
                            <comment id="399889" author="jeff.yemin" created="Sat, 10 Aug 2013 00:05:57 +0000"  >&lt;p&gt;MongoSession uses them: &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/SpringSource/grails-data-mapping/blob/master/grails-datastore-mongo/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java#L74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/SpringSource/grails-data-mapping/blob/master/grails-datastore-mongo/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java#L74&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/SpringSource/grails-data-mapping/blob/master/grails-datastore-mongo/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java#L133&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/SpringSource/grails-data-mapping/blob/master/grails-datastore-mongo/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java#L133&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Are you using GORM sessions, by any chance?  If so, I think I see the what the problem is.&lt;/p&gt;</comment>
                            <comment id="399562" author="fabiangebert" created="Fri, 9 Aug 2013 16:56:46 +0000"  >&lt;p&gt;Hi Jeff,&lt;/p&gt;

&lt;p&gt;I&apos;m not using GPars. And I&apos;ve never heard of DB.requestStart nor DB.requestDone. Perhaps the GORM plugin does use these methods?&lt;/p&gt;</comment>
                            <comment id="399500" author="jeff.yemin" created="Fri, 9 Aug 2013 15:35:35 +0000"  >&lt;p&gt;Hi Noam,&lt;/p&gt;

&lt;p&gt;The only thread local state we keep in the driver is due to use of DB.requestStart and DB.requestDone, and the thread local management did change in 2.11.  Does your application by any chance use these methods along with GPars?  Can you share any of the code?&lt;/p&gt;

&lt;p&gt;Fabian, are you also using GPars and or DB.requestStart/requestDone?&lt;/p&gt;</comment>
                            <comment id="397632" author="noamt" created="Wed, 7 Aug 2013 07:32:34 +0000"  >&lt;p&gt;So I hadn&apos;t had too much time to dig in any deeper, but coming from the context of a &lt;tt&gt;Grails&lt;/tt&gt; application it seems that the issue is tied to operations done in external threads.&lt;br/&gt;
When I upgrade the Java driver from 2.10.x to 2.11.x (changing nothing else in the application), operations done asynchronously via libraries such as &lt;tt&gt;GPars&lt;/tt&gt; start to leak &lt;tt&gt;DBPorts&lt;/tt&gt;; perhaps some &lt;tt&gt;ThreadLocal&lt;/tt&gt; state is saved somewhere?&lt;br/&gt;
I might have time to build a reproducible test case later on in the week.&lt;/p&gt;</comment>
                            <comment id="395498" author="noamt" created="Sun, 4 Aug 2013 10:13:51 +0000"  >&lt;p&gt;I too am affected by this issue&lt;/p&gt;</comment>
                            <comment id="393820" author="fabiangebert" created="Thu, 1 Aug 2013 19:43:29 +0000"  >&lt;p&gt;My config is default except for&lt;/p&gt;

&lt;p&gt;connectionsPerHost = 200&lt;br/&gt;
threadsAllowedToBlockForConnectionMultiplier = 750&lt;br/&gt;
autoConnectRetry = true&lt;br/&gt;
connectTimeout = 15000&lt;/p&gt;

&lt;p&gt;&amp;gt; Why are you sure this is not a change in the behavior/load on the web app?&lt;/p&gt;

&lt;p&gt;Because we reverted back to 2.10 and it is working again under the same load.&lt;/p&gt;

&lt;p&gt;&amp;gt; What is the size of the connection pool (connectionsPerHost in MongoClientOptions)?&lt;/p&gt;

&lt;p&gt;200&lt;/p&gt;

&lt;p&gt;&amp;gt; How many threads are created by the container?&lt;/p&gt;

&lt;p&gt;We&apos;ve got a Tomcat 7 in default settings. I think that&apos;s about 100 threads, am I right?&lt;/p&gt;

&lt;p&gt;&amp;gt; Would it be possible to attach a thread dump from around the time of the exception?&lt;/p&gt;

&lt;p&gt;I cannot test it on the production machine, as we don&apos;t want to break it. I can try to reproduce the error on a test environment, however.&lt;/p&gt;

&lt;p&gt;&amp;gt; Does the exception keep getting thrown, or is intermittent?&lt;/p&gt;

&lt;p&gt;It gets thrown on all subsequent requests so the server is dead (except for calls not involving database)&lt;/p&gt;

&lt;p&gt;&amp;gt; Are you setting a socket timeout in MongoClientOptions?&lt;/p&gt;

&lt;p&gt;No, we&apos;ve got a nightly map reduce running, I want to avoid that to be killed. The map reduce always successfully finished so far, no matter what driver version&lt;/p&gt;

&lt;p&gt;Hope that helps!&lt;/p&gt;</comment>
                            <comment id="393755" author="jeff.yemin" created="Thu, 1 Aug 2013 18:30:43 +0000"  >&lt;p&gt;Some questions:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Why are you sure this is not a change in the behavior/load on the web app?&lt;/li&gt;
	&lt;li&gt;What is the size of the connection pool (connectionsPerHost in MongoClientOptions)?&lt;/li&gt;
	&lt;li&gt;How many threads are created by the container?&lt;/li&gt;
	&lt;li&gt;Would it be possible to attach a thread dump from around the time of the exception?&lt;/li&gt;
	&lt;li&gt;Does the exception keep getting thrown, or is intermittent?&lt;/li&gt;
	&lt;li&gt;Are you setting a socket timeout in MongoClientOptions?&lt;/li&gt;
&lt;/ul&gt;

</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="78585">JAVA-853</issuekey>
        </issuelink>
                            </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|hrrzhr:</customfieldvalue>

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