<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:57:05 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-2395] com.mongodb.MongoException$CursorNotFound: cursor not found on server</title>
                <link>https://jira.mongodb.org/browse/JAVA-2395</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hello Team,&lt;br/&gt;
We are getting  the  following exception in our application.&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Exception&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;com.mongodb.MongoCursorNotFoundException: Query failed with error code -5 and error message &apos;Cursor 43249415092 not found on server xx.xx.xx.xx:27017&apos; &lt;br/&gt;
        at com.mongodb.connection.GetMoreProtocol.receiveMessage(GetMoreProtocol.java:115)&lt;br/&gt;
        at com.mongodb.connection.GetMoreProtocol.execute(GetMoreProtocol.java:68)&lt;br/&gt;
        at com.mongodb.connection.GetMoreProtocol.execute(GetMoreProtocol.java:37)&lt;br/&gt;
        at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:155)&lt;br/&gt;
        at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:219)&lt;br/&gt;
        at com.mongodb.connection.DefaultServerConnection.getMore(DefaultServerConnection.java:194)&lt;br/&gt;
        at com.mongodb.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:197)&lt;br/&gt;
        at com.mongodb.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:93)&lt;br/&gt;
        at com.mongodb.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:46)&lt;br/&gt;
        at com.mongodb.DBCursor.hasNext(DBCursor.java:152)&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We are unable to find the cause since we are getting this rarely&lt;br/&gt;
.Sometimes Our application is unable to read from the cursor but still we are not receiving any exception.Can you help me out on this?&lt;/p&gt;</description>
                <environment></environment>
        <key id="334082">JAVA-2395</key>
            <summary>com.mongodb.MongoException$CursorNotFound: cursor not found on server</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="ross@mongodb.com">Ross Lawley</assignee>
                                    <reporter username="jaipal_543">Jaipal Reddy</reporter>
                        <labels>
                            <label>Bug</label>
                    </labels>
                <created>Thu, 24 Nov 2016 10:32:14 +0000</created>
                <updated>Fri, 9 Feb 2018 11:47:27 +0000</updated>
                            <resolved>Thu, 24 Nov 2016 14:42:02 +0000</resolved>
                                    <version>3.0.4</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1800559" author="swapnil0504" created="Fri, 9 Feb 2018 11:47:27 +0000"  >&lt;p&gt;@Jaipal Reddy&lt;br/&gt;
Have you got any solution?&lt;/p&gt;</comment>
                            <comment id="1442009" author="ross@10gen.com" created="Thu, 24 Nov 2016 14:41:53 +0000"  >&lt;p&gt;Looks like the code is in the internal JDK &lt;tt&gt;java.net.SocketInputStream.socketRead0&lt;/tt&gt; method and no exceptions have been propagated back to the driver.  There have &lt;a href=&quot;https://bugs.openjdk.java.net/browse/JDK-8075484&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;JDK bugs&lt;/a&gt; reported for this issue but it seems it might be JDK dependent.&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                            <comment id="1441956" author="jaipal_543" created="Thu, 24 Nov 2016 12:11:15 +0000"  >&lt;p&gt;Hii Ross,&lt;/p&gt;

&lt;p&gt;Thank you  for the  quick response.&lt;/p&gt;

&lt;p&gt;We had another issue.&lt;/p&gt;

&lt;p&gt;In cases where our application is unable to read data from cursor and we hadn&apos;t received any exception,We took the thread dump and found that the thread reading data getting stuck in RUNNABLE state.&lt;/p&gt;

&lt;p&gt;Following is the thread dump.&lt;/p&gt;

&lt;p&gt;   java.lang.Thread.State: RUNNABLE&lt;br/&gt;
        at java.net.SocketInputStream.socketRead0(Native Method)&lt;br/&gt;
        at java.net.SocketInputStream.read(SocketInputStream.java:152)&lt;br/&gt;
        at java.net.SocketInputStream.read(SocketInputStream.java:122)&lt;br/&gt;
        at com.mongodb.connection.SocketStream.read(SocketStream.java:85)&lt;br/&gt;
        at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:503)&lt;br/&gt;
        at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:221)&lt;br/&gt;
        at com.mongodb.connection.UsageTrackingInternalConnection.receiveMessage(UsageTrackingInternalConnection.java:102)&lt;br/&gt;
        at com.mongodb.connection.DefaultConnectionPool$PooledConnection.receiveMessage(DefaultConnectionPool.java:416)&lt;br/&gt;
        at com.mongodb.connection.GetMoreProtocol.receiveMessage(GetMoreProtocol.java:112)&lt;br/&gt;
        at com.mongodb.connection.GetMoreProtocol.execute(GetMoreProtocol.java:68)&lt;br/&gt;
        at com.mongodb.connection.GetMoreProtocol.execute(GetMoreProtocol.java:37)&lt;br/&gt;
        at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:155)&lt;br/&gt;
        at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:219)&lt;br/&gt;
        at com.mongodb.connection.DefaultServerConnection.getMore(DefaultServerConnection.java:194)&lt;br/&gt;
        at com.mongodb.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:197)&lt;br/&gt;
        at com.mongodb.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:93)&lt;br/&gt;
        at com.mongodb.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:46)&lt;br/&gt;
        at com.mongodb.DBCursor.hasNext(DBCursor.java:152)&lt;/p&gt;

&lt;p&gt;Why the driver is not throwing any exception?&lt;/p&gt;</comment>
                            <comment id="1441947" author="ross@10gen.com" created="Thu, 24 Nov 2016 11:42:23 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jaipal_543&quot; class=&quot;user-hover&quot; rel=&quot;jaipal_543&quot;&gt;jaipal_543&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the ticket.  Idle cursors are automatically timed out by the server, if an application calls for more results on a timed out cursor then you will get a &lt;tt&gt;CursorNotFound&lt;/tt&gt; exception.&lt;/p&gt;

&lt;p&gt;The default timeout is 10 minutes but can be configured via the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/parameters/#param.cursorTimeoutMillis&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;cursorTimeoutMillis parameter&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;You can also turn off cursor timeouts in the Java API via &lt;a href=&quot;http://api.mongodb.com/java/3.3/com/mongodb/DBCursor.html#addOption-int-&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DBCursor#addOption&lt;/a&gt; and passing the &lt;a href=&quot;http://api.mongodb.com/java/3.3/com/mongodb/Bytes.html#QUERYOPTION_NOTIMEOUT&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;QUERYOPTION_NOTIMEOUT&lt;/a&gt; value.  However, care should be taken as after setting the noCursorTimeout option, you must either close the cursor manually with cursor.close() or by exhausting the cursor&#8217;s results.&lt;/p&gt;

&lt;p&gt;I hope that helps,&lt;/p&gt;

&lt;p&gt;Ross&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|hss7g7:</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>