<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:37 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-585] SocketTimeoutException: Read timed out</title>
                <link>https://jira.mongodb.org/browse/JAVA-585</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We have the following time out issue in a Grails application with a single mongoDB instance hosted in a Windows Azure environment (we have also tried in MongoLabs and found the same issue), first time application works fine but if we don&apos;t perform any operation with mongoDB (like db.find, db.findOne, etc) in 5 minutes time period then the next query will throw a &quot;Read timed out&quot; exception, after that exception we need to retry again and it will work (this probably related to &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-335&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/JAVA-335&lt;/a&gt;)&lt;br/&gt;
The application has been deployed in cloudfoundry where we didn&apos;t see this error, application running with local mongoDB is running fine, so it&apos;s related to something in Azure environment and the driver (firewall was disabled and issue persists).&lt;/p&gt;

&lt;p&gt;We have been reading about existing similar issues and these are the questions:&lt;/p&gt;

&lt;p&gt;1) Do we need to manually retry when exception occurs?&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-481&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/JAVA-481&lt;/a&gt; - Driver not retrying on Connection timed out SocketException&lt;/p&gt;

&lt;p&gt;2) Do we need to use any other configuration in the MongoOptions? we have tried different settings &lt;br/&gt;
socketKeepAlive = true, connectTimeout = 200, socketTimeout = 200, wtimeout = 1000 and autoConnectRetry = true and is not working. &lt;br/&gt;
&lt;a href=&quot;https://groups.google.com/forum/?fromgroups#!topic/mongodb-dev/bPdUpcpyTZs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://groups.google.com/forum/?fromgroups#!topic/mongodb-dev/bPdUpcpyTZs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Is this an existing issue?&lt;/p&gt;

&lt;p&gt;Read timed out. Stacktrace follows:&lt;br/&gt;
Message: Read timed out&lt;br/&gt;
   Line | Method&lt;br/&gt;
-&amp;gt;&amp;gt; 129 | read      in java.net.SocketInputStream&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
&lt;div class=&apos;table-wrap&apos;&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   218 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; fill      in java.io.BufferedInputStream&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   258 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; read1 . . in     &apos;&apos;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   317 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; read      in     &apos;&apos;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    35 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; readFully in org.bson.io.Bits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    28 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; readFully in     &apos;&apos;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    39 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; &amp;lt;init&amp;gt; .  in com.mongodb.Response&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   128 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; go        in com.mongodb.DBPort&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;    79 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; call . .  in     &apos;&apos;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   218 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; call      in com.mongodb.DBTCPConnector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   305 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; __find .  in com.mongodb.DBApiLayer$MyCollection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   369 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; _check    in com.mongodb.DBCursor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   498 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; _hasNext  in     &apos;&apos;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;   523 &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; hasNext   in     &apos;&apos;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Please let us know any comment. Thanks!&lt;/p&gt;</description>
                <environment>MongoDB hosted in Windows Azure environment or MongoLabs, Grails 2.0.4</environment>
        <key id="40708">JAVA-585</key>
            <summary>SocketTimeoutException: Read timed out</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="moctezuma">pablo GM</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Jun 2012 19:09:54 +0000</created>
                <updated>Thu, 12 Jul 2012 21:01:50 +0000</updated>
                            <resolved>Thu, 12 Jul 2012 21:01:42 +0000</resolved>
                                    <version>2.7.1</version>
                                                    <component>Connection Management</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="142549" author="jeff.yemin" created="Thu, 12 Jul 2012 21:01:42 +0000"  >&lt;p&gt;Since I haven&apos;t heard back from you, I&apos;m going to close this.&lt;/p&gt;</comment>
                            <comment id="128194" author="jeff.yemin" created="Thu, 7 Jun 2012 20:41:37 +0000"  >&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;This is most likely more of a networking issue than anything having to do specifically with the Java driver.  Can you post your question to &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user?&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://groups.google.com/forum/#!forum/mongodb-user?&lt;/a&gt; There are more people on that list that are familar with Azure and MongoLabs.&lt;/p&gt;

&lt;p&gt;Offhand, I would say:&lt;/p&gt;

&lt;p&gt;1) In general, you do have to be prepared to handle exceptions thrown from DBCollection methods.&lt;br/&gt;
2) Your socket timeouts may be a bit short.  Try something more in the range of 10 seconds.&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|hrhb2v:</customfieldvalue>

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