<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:58:46 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-3094] How to handle MongoSocketReadException</title>
                <link>https://jira.mongodb.org/browse/JAVA-3094</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description></description>
                <environment></environment>
        <key id="634355">JAVA-3094</key>
            <summary>How to handle MongoSocketReadException</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="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="leohanchn@gmail.com">Leo Han</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Nov 2018 12:20:20 +0000</created>
                <updated>Fri, 27 Oct 2023 13:21:06 +0000</updated>
                            <resolved>Thu, 15 Nov 2018 14:57:14 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2710301" author="jeff.yemin" created="Tue, 7 Jan 2020 18:19:01 +0000"  >&lt;p&gt;Note also that as of the 3.11 release, the driver also supports retryable reads (&lt;tt&gt;retryReads=true&lt;/tt&gt; in the connection string.  Also note that as of the 3.11 release, retryable reads and retryable writes are enabled by default.&lt;/p&gt;</comment>
                            <comment id="2063148" author="jeff.yemin" created="Thu, 15 Nov 2018 14:57:06 +0000"  >&lt;p&gt;To reiterate, the immediate cause is that the MongoDB server shut down or crashed, or there was a failure somewhere in the network layer.  If you enable retryable writes (&lt;tt&gt;retryWrites=true&lt;/tt&gt; in the connection string), the driver will attempt to retry the write on your behalf.  For reads, you&apos;ll have to catch the exception and execute the retry in the application.&lt;/p&gt;

&lt;p&gt;Hope this helps.  I&apos;m going to close this issue now, as the driver is working as designed.&lt;/p&gt;</comment>
                            <comment id="2062991" author="leohanchn@gmail.com" created="Thu, 15 Nov 2018 12:54:36 +0000"  >&lt;p&gt;Hi&#160;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jeff.yemin&quot; class=&quot;user-hover&quot; rel=&quot;jeff.yemin&quot;&gt;jeff.yemin&lt;/a&gt;, thanks for the input.&lt;/p&gt;

&lt;p&gt;In my program I have to put some read and write operations in the loop, is this likely to be the cause of this error?&lt;/p&gt;

&lt;p&gt;Regards,Leo&lt;/p&gt;</comment>
                            <comment id="2062985" author="jeff.yemin" created="Thu, 15 Nov 2018 12:42:39 +0000"  >&lt;p&gt;You&apos;re getting the following exception: &lt;tt&gt;Caused by: com.mongodb.MongoSocketReadException: Prematurely reached end of stream&lt;/tt&gt;.  This typically happens when the MongoDB server is shut down, and does not indicate a bug in the driver.&lt;/p&gt;

&lt;p&gt;If your application needs to be resilient to server restarts, crashes or transient network failures, there are a few things you can do:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Utilize the recently added support for retryable writes&lt;/li&gt;
	&lt;li&gt;Execute read operations in a retry loop (support for retryable reads is expected to be added in the next release)&lt;/li&gt;
&lt;/ul&gt;

</comment>
                            <comment id="2062979" author="leohanchn@gmail.com" created="Thu, 15 Nov 2018 12:36:22 +0000"  >&lt;p&gt;Hi&#160;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jeff.yemin&quot; class=&quot;user-hover&quot; rel=&quot;jeff.yemin&quot;&gt;jeff.yemin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I uploaded the log file&#65292;And I have set the parameters of the connection pool, as follows&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/201074/201074_image-2018-11-15-20-38-44-309.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="2062971" author="jeff.yemin" created="Thu, 15 Nov 2018 12:24:51 +0000"  >&lt;p&gt;HI &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=leohanchn%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;leohanchn@gmail.com&quot;&gt;leohanchn@gmail.com&lt;/a&gt; looks like you hit enter prematurely.  Please comment on what the error is, and I&apos;ll update the description.  Or let me know that you didn&apos;t intend to file this issue, and I&apos;ll close it out.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="211896">JAVA-1868</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="201073" name="debug.log" size="20138" author="leohanchn@gmail.com" created="Thu, 15 Nov 2018 12:36:13 +0000"/>
                            <attachment id="201074" name="image-2018-11-15-20-38-44-309.png" size="67388" author="leohanchn@gmail.com" created="Thu, 15 Nov 2018 12:38:44 +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|hu354n:</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>