<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:57:27 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-2528] Mongo router (mongos) connection pool &amp; timeout trouble</title>
                <link>https://jira.mongodb.org/browse/JAVA-2528</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;I have &lt;a href=&quot;https://stackoverflow.com/questions/44320396/mongo-router-mongos-connection-pool-timeout-trouble&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;a question on StackOverflow&lt;/a&gt; describing the situation&lt;/p&gt;

&lt;p&gt;In short the configuration for timeout &amp;amp; connection pool max size was ignored, and driver somehow increased the size of the pool 4x, while connections were not returning or timing out.&lt;/p&gt;</description>
                <environment></environment>
        <key id="389463">JAVA-2528</key>
            <summary>Mongo router (mongos) connection pool &amp; timeout trouble</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="bureaquete">Burak Bayrakdar</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Jun 2017 05:52:55 +0000</created>
                <updated>Wed, 11 Sep 2019 19:10:55 +0000</updated>
                            <resolved>Mon, 12 Jun 2017 17:12:23 +0000</resolved>
                                    <version>3.2.2</version>
                                                    <component>Connection Management</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1594568" author="jeff.yemin" created="Mon, 12 Jun 2017 17:12:23 +0000"  >&lt;p&gt;Closing as Cannot Reproduce.  We&apos;ll be happy to re-open the issue if more information becomes available.&lt;/p&gt;</comment>
                            <comment id="1594567" author="jeff.yemin" created="Mon, 12 Jun 2017 17:11:29 +0000"  >&lt;p&gt;Hi Burak,&lt;/p&gt;

&lt;p&gt;To respond to your last question about maxConnectionLifeTime:  that setting only controls the behavior of an idle connection in the connection pool.  It will not cause an a socket to be closed abruptly while in use.  To force an in-use socket to close, your application would have to set the socketTimeout property in MongoClientOptions.&lt;/p&gt;</comment>
                            <comment id="1588182" author="bureaquete" created="Tue, 6 Jun 2017 04:14:09 +0000"  >&lt;p&gt;I&apos;d like to ask an extra question also for a solution I am trying to come up with.&lt;/p&gt;

&lt;p&gt;I tried to utilize &lt;b&gt;maxConnectionLifeTime&lt;/b&gt; configuration, with a value of 100, and tested on a script call like;&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongoTemplate.scriptOps().execute(new ExecutableMongoScript(&quot;function() { sleep(10000); }&quot;))&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;This connection life time does not kill the above sleep call for example, shouldn&apos;t it timeout even if the connection is in use? None of the available timeout configurations kill this kinda connections it seems.&lt;/p&gt;</comment>
                            <comment id="1587142" author="bureaquete" created="Mon, 5 Jun 2017 07:10:28 +0000"  >&lt;p&gt;There is no proper log to work with, there is no application log, all mongo connections were waiting as normal, without timing out, mongos logs were also pretty OK, the only weird thing that I&apos;ve found out is that the abnormal connection pool size was not because of my application but due to a monitoring service that is separate from my product. Somehow the mongos instance stopped responding, and due to this, none of the timeout configuration I&apos;ve set up have worked. I cannot reproduce this state of mongos instance, and sorry for the vagueness of the question, and the lack of details, but this is the situation, I will update the driver version, and try to implement a better logic in my app to respond when mongos instance hangs. In current state app has done nothing, but Apache killed the call since it was &amp;gt; 60 seconds.&lt;/p&gt;</comment>
                            <comment id="1585855" author="jeff.yemin" created="Fri, 2 Jun 2017 13:28:59 +0000"  >&lt;p&gt;Are you able to attach application and mongos logs so that we can examine them?  Otherwise there&apos;s not a lot to go on.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="157826" name="mongos.zip" size="387567" author="bureaquete" created="Tue, 6 Jun 2017 04:27:00 +0000"/>
                    </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|ht0i2v:</customfieldvalue>

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