<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:11 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-834] Set a sane default socketTimeout</title>
                <link>https://jira.mongodb.org/browse/JAVA-834</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The current default is to have no socket timeout at all, in case of a replicaset when a primary is not reachable this blocks server threads that try to write. &lt;br/&gt;
I would consider this a bad default, it makes a lot more sense to have a sane default of say 120s to allow the software to gracefully handle this situation, now due to the current setup, it caused thread starvation on our Glassfish server so it went completely down, while read operations should have still been possible IMHO.&lt;/p&gt;

&lt;p&gt;Trace logs:&lt;/p&gt;

&lt;p&gt;Thread Synchronization Statistics:&lt;br/&gt;
-----------------------&lt;br/&gt;
Number of times this thread was blocked (to enter/reenter a Monitor): 2&lt;br/&gt;
Number of times this thread waited for a notification (i.e. it was in WAITING or TIMED_WAITING state): 11,596&lt;br/&gt;
Total CPU time for this thread: 32 seconds 617,224,466 nanoseconds.&lt;br/&gt;
User-level CPU time for this thread: 32 seconds 617,224,466 nanoseconds.&lt;br/&gt;
Object Monitors currently held or requested by this thread: []&lt;br/&gt;
Ownable Synchronizers (e.g. ReentrantLock and ReentrantReadWriteLock) held by this thread: []&lt;br/&gt;
--------------------------------------------------------------------------------&lt;br/&gt;
Thread Execution Information:&lt;br/&gt;
-----------------------&lt;br/&gt;
Thread &quot;http-thread-pool-8080(5)&quot; thread-id: 56 thread-state: RUNNABLE Running in native&lt;br/&gt;
	 at: java.net.SocketInputStream.socketRead0(Native Method)&lt;br/&gt;
	 at: java.net.SocketInputStream.read(SocketInputStream.java:150)&lt;br/&gt;
	 at: java.net.SocketInputStream.read(SocketInputStream.java:121)&lt;br/&gt;
	 at: java.io.BufferedInputStream.fill(BufferedInputStream.java:235)&lt;br/&gt;
	 at: java.io.BufferedInputStream.read1(BufferedInputStream.java:275)&lt;br/&gt;
	 at: java.io.BufferedInputStream.read(BufferedInputStream.java:334)&lt;br/&gt;
	 at: org.bson.io.Bits.readFully(Bits.java:46)&lt;br/&gt;
	 at: org.bson.io.Bits.readFully(Bits.java:33)&lt;br/&gt;
	 at: org.bson.io.Bits.readFully(Bits.java:28)&lt;br/&gt;
	 at: com.mongodb.Response.&amp;lt;init&amp;gt;(Response.java:40)&lt;br/&gt;
	 at: com.mongodb.DBPort.go(DBPort.java:124)&lt;br/&gt;
	 at: com.mongodb.DBPort.go(DBPort.java:88)&lt;br/&gt;
	 at: com.mongodb.DBPort.findOne(DBPort.java:143)&lt;br/&gt;
	 at: com.mongodb.DBPort.runCommand(DBPort.java:148)&lt;br/&gt;
	 at: com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:140)&lt;br/&gt;
	 at: com.mongodb.DBTCPConnector.say(DBTCPConnector.java:183)&lt;br/&gt;
	 at: com.mongodb.DBTCPConnector.say(DBTCPConnector.java:155)&lt;br/&gt;
	 at: com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:349)&lt;br/&gt;
	 at: com.mongodb.DBCollection.update(DBCollection.java:177)&lt;br/&gt;
	 at: com.mongodb.DBCollection.update(DBCollection.java:208)&lt;br/&gt;
	 at: com.mongodb.DBCollection.update(DBCollection.java:220)&lt;/p&gt;</description>
                <environment></environment>
        <key id="76383">JAVA-834</key>
            <summary>Set a sane default socketTimeout</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="jayv">Jo Voordeckers</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 May 2013 17:18:51 +0000</created>
                <updated>Tue, 25 Jun 2013 11:13:53 +0000</updated>
                            <resolved>Tue, 25 Jun 2013 11:13:52 +0000</resolved>
                                    <version>2.11.1</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="343993" author="jeff.yemin" created="Thu, 23 May 2013 19:02:09 +0000"  >&lt;p&gt;So set the socketTimeout=2000.&lt;/p&gt;

&lt;p&gt;The reason we don&apos;t set a socket timeout by default is that queries can be slow if they are un-indexed and there is a lot of documents, so anything we choose would be arbitrary.&lt;/p&gt;</comment>
                            <comment id="343985" author="jayv" created="Thu, 23 May 2013 18:50:33 +0000"  >&lt;p&gt;We&apos;re not handling that many reqs, but at least with a short timeout the application has more chances of keeping up before it collapses. &lt;br/&gt;
120s is probably too conservative, I&apos;ve set it at 10s now, but I&apos;m no socket nor mongo expert. &lt;br/&gt;
Ideally I would like my reqs to fail within 2-3s, what would be the optimal MongoClientOptions for this?&lt;/p&gt;</comment>
                            <comment id="343911" author="jeff.yemin" created="Thu, 23 May 2013 17:44:54 +0000"  >&lt;p&gt;I don&apos;t consider this a blocker since there is a simple workaround.&lt;/p&gt;

&lt;p&gt;Won&apos;t a 120 second timeout cause thread starvation as well?  How many requests/second are you handling?&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|hrqqxj:</customfieldvalue>

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