<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:58:26 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-2945] Mongo Driver with bad connection hanging forever and not timing out</title>
                <link>https://jira.mongodb.org/browse/JAVA-2945</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;We are having a weird issue with Mongo java driver 3.5.0. We have following error initially returned by Mongo and application is handling error&#160;smoothly. But after this error, whatever next request picks mongo connection, Next&#160;request is hanging forever and not timing out after a certain interval.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;client-options&lt;br/&gt;
mongo.connectionsPerHost=20&lt;br/&gt;
mongo.threadsAllowedToBlockForConnectionMultiplier=2&lt;br/&gt;
mongo.connectTimeout=30000&lt;br/&gt;
mongo.maxWaitTime=10000&lt;br/&gt;
mongo.socketKeepAlive=true&lt;br/&gt;
mongo.socketTimeout=20000&lt;br/&gt;
mongo.maxConnectionIdleTime=300000&lt;br/&gt;
mongo.maxConnectionLifeTime=43200000&lt;br/&gt;
mongo.heartbeatFrequency=3600000&lt;br/&gt;
mongo.minHeartbeatFrequency=500&lt;br/&gt;
mongo.heartbeatConnectTimeout=20000&lt;br/&gt;
mongo.heartbeatSocketTimeout=20000&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Caused by: com.mongodb.MongoQueryException: Query failed with error code 35 and error message &apos;&apos; on server localhost:27017Caused by: com.mongodb.MongoQueryException: Query failed with error code 35 and error message &apos;&apos; on server localhost:27017 at com.mongodb.connection.ProtocolHelper.getQueryFailureException(ProtocolHelper.java:131) at com.mongodb.connection.GetMoreProtocol.execute(GetMoreProtocol.java:88) at com.mongodb.connection.GetMoreProtocol.execute(GetMoreProtocol.java:49) at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:159) at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289) at com.mongodb.connection.DefaultServerConnection.getMore(DefaultServerConnection.java:254) at com.mongodb.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:218) at com.mongodb.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:105) at com.mongodb.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:46) at com.mongodb.DBCursor.hasNext(DBCursor.java:145) at com.mongodb.DBCursor.fillArray(DBCursor.java:910) at com.mongodb.DBCursor.toArray(DBCursor.java:655) at com.mongodb.DBCursor.toArray(DBCursor.java:643)&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="594128">JAVA-2945</key>
            <summary>Mongo Driver with bad connection hanging forever and not timing out</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="pitani">RameshPitani</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Aug 2018 18:47:34 +0000</created>
                <updated>Fri, 27 Oct 2023 13:21:07 +0000</updated>
                            <resolved>Tue, 28 Aug 2018 02:09:00 +0000</resolved>
                                    <version>3.5.0</version>
                                                    <component>Connection Management</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1987110" author="pitani" created="Mon, 27 Aug 2018 22:11:25 +0000"  >&lt;p&gt;Hi Jeff, No. I have informed about this on 08/24. IBM exposed&#160;mongo interface on top of TPF mainframe system. This allows java&#160;application to talk to TPF Mainframe system using NoSQL. Initially, when I raised this defect, I thought 2nd Issue(Connection hung) is related to Java Mongo driver issue. Today IBM confirmed that there is a bug on mainframe system (Closing Mongo Connection during cursor close) for 2nd error.&lt;/p&gt;

&lt;p&gt;For 1st error((Query failed with error code 35 and error message)), IBM Mongo server can not handle if Find and GetMore come on different Connection. This is the limitation of IBM mongo server.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.ibm.com/support/knowledgecenter/en/SSB23S_1.1.0.15/gtpd5/cmdbifcontainer.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.ibm.com/support/knowledgecenter/en/SSB23S_1.1.0.15/gtpd5/cmdbifcontainer.html&lt;/a&gt;&#160;&lt;/p&gt;


&lt;p&gt;Your prompt responses helped us to narrow down the problem. There is no problem with mongo java driver. Thank you for all your help. We can close this JIRA.&#160;&lt;/p&gt;</comment>
                            <comment id="1987029" author="jeff.yemin" created="Mon, 27 Aug 2018 20:53:23 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pitani&quot; class=&quot;user-hover&quot; rel=&quot;pitani&quot;&gt;pitani&lt;/a&gt; can you clarify? Are you not running against a MongoDB binary that was built by MongoDB, Inc?  If not, where is the binary from?&lt;/p&gt;</comment>
                            <comment id="1986985" author="pitani" created="Mon, 27 Aug 2018 20:15:42 +0000"  >&lt;p&gt;The version of MongoDB on TPF is compatible with 2.6, however there are, certain 2.6 commands are not supported.&lt;/p&gt;</comment>
                            <comment id="1986974" author="jeff.yemin" created="Mon, 27 Aug 2018 20:10:51 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pitani&quot; class=&quot;user-hover&quot; rel=&quot;pitani&quot;&gt;pitani&lt;/a&gt; for question 1, I&apos;m asking what version of the MongoDB server that you are connecting to, not the driver version.  Driver and server are versioned independently of each other.&lt;/p&gt;</comment>
                            <comment id="1986914" author="pitani" created="Mon, 27 Aug 2018 19:43:29 +0000"  >&lt;p&gt;Here I attached Thread Dump file when request hung.&lt;/p&gt;</comment>
                            <comment id="1986869" author="pitani" created="Mon, 27 Aug 2018 19:14:48 +0000"  >&lt;p&gt;Jeff, &lt;/p&gt;

&lt;p&gt;We have observed an interesting clue in the log about Connection Hang Issue in the log (2nd Issue after Query failed with error code 35 and error message). &lt;br/&gt;
In our application, We are not Closing DBCursor manually. Cursor Closing is delegated to Spring&#160;&lt;b&gt;MongoClientOptions.Builder.cursorFinalizerEnabled.&lt;/b&gt;&#160;This is the reason for &quot;CleanCursors-2-thread-1&quot; thread in the log file. CleanCursors thread is running after we have this error &quot;Query failed with error code 35 and error message&quot; for a different request on Connection Id(localValue:23). After&#160;&quot;CleanCursors&quot; killed cursor for ConnectionId(localValue:23), New request&#160;10499772172419394 used same Mongo Connection(localValue:23). This 10499772172419394 request hang and never got the response back. What could be the problem? Is CleanCursors thread also closing Mongo Connection and Request hang for ever?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;2018-08-27 12:52:23,333|DEBUG|||CleanCursors-2-thread-1|org.mongodb.driver.protocol.killcursor||Killing cursors &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; on connection &lt;span class=&quot;error&quot;&gt;&amp;#91;connectionId\{localValue:23, serverValue:0}&amp;#93;&lt;/span&gt; to server mongodb.prod.sabre.com:27017&lt;br/&gt;
2018-08-27 12:52:23,334|TRACE|||CleanCursors-2-thread-1|org.mongodb.driver.connection||Checked in connection &lt;span class=&quot;error&quot;&gt;&amp;#91;connectionId\{localValue:23, serverValue:0}&amp;#93;&lt;/span&gt; to server mongodb.prod.sabre.com:27017&lt;br/&gt;
2018-08-27 12:52:24,684|TRACE|10499772172419394|AS|ckiFromTG--MOM-Consumer-Thread-6|org.mongodb.driver.connection||Checked out connection &lt;span class=&quot;error&quot;&gt;&amp;#91;connectionId\{localValue:23, serverValue:0}&amp;#93;&lt;/span&gt; to server mongodb.prod.sabre.com:27017&lt;br/&gt;
2018-08-27 12:52:24,684|DEBUG|10499772172419394|AS|ckiFromTG--MOM-Consumer-Thread-6|org.mongodb.driver.protocol.query||Sending query of namespace tpfdf.LF22AA on connection &lt;span class=&quot;error&quot;&gt;&amp;#91;connectionId\{localValue:23, serverValue:0}&amp;#93;&lt;/span&gt; to server mongodb.prod.sabre.com:27017&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="1986859" author="pitani" created="Mon, 27 Aug 2018 19:00:42 +0000"  >&lt;p&gt;Thank you Jeff.&lt;/p&gt;

&lt;p&gt;1. This is our version. Please let us know if you see any problem with version I am using.&lt;/p&gt;

&lt;p&gt;&amp;lt;spring-data-mongodb.version&amp;gt;1.8.4.RELEASE&amp;lt;/spring-data-mongodb.version&amp;gt;&lt;br/&gt;
&amp;lt;mongo-java-driver.version&amp;gt;3.5.0&amp;lt;/mongo-java-driver.version&amp;gt;&lt;/p&gt;

&lt;p&gt;2. Yes. We are getting Error &quot;Query failed with error code 35 and error message&quot; even when we tested against&#160;the standalone server.&#160;&#160;&lt;/p&gt;

&lt;p&gt;mongo.host=ACPSTSB.vpars.sabre.com&lt;br/&gt;
mongo.port=27017&lt;br/&gt;
mongo.credentials=UserName:Password@tpfdf&lt;br/&gt;
mongo.connectTimeout=10000&lt;br/&gt;
mongo.maxWaitTime=10000&lt;br/&gt;
mongo.socketKeepAlive=true&lt;br/&gt;
mongo.socketTimeout=10000&lt;br/&gt;
mongo.maxConnectionIdleTime=300000&lt;br/&gt;
mongo.maxConnectionLifeTime=43200000&lt;br/&gt;
mongo.heartbeatFrequency=3600000&lt;br/&gt;
mongo.minHeartbeatFrequency=500&lt;br/&gt;
mongo.heartbeatConnectTimeout=20000&lt;br/&gt;
mongo.heartbeatSocketTimeout=20000&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Spring Context file&lt;/b&gt;:&lt;br/&gt;
&amp;lt;mongo:mongo-client host=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.host&amp;#39;&amp;#93;&lt;/span&gt;}&quot; port=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.port&amp;#39;&amp;#93;&lt;/span&gt;}&quot; credentials=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.credentials&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&amp;gt; &lt;br/&gt;
&amp;lt;mongo:client-options connections-per-host=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.connectionsPerHost&amp;#39;&amp;#93;&lt;/span&gt;}&quot; threads-allowed-to-block-for-connection-multiplier=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.threadsAllowedToBlockForConnectionMultiplier&amp;#39;&amp;#93;&lt;/span&gt;}&quot; connect-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.connectTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot; max-wait-time=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.maxWaitTime&amp;#39;&amp;#93;&lt;/span&gt;}&quot; socket-keep-alive=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.socketKeepAlive&amp;#39;&amp;#93;&lt;/span&gt;}&quot; socket-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.socketTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot; max-connection-idle-time=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.maxConnectionIdleTime&amp;#39;&amp;#93;&lt;/span&gt;}&quot; max-connection-life-time=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.maxConnectionLifeTime&amp;#39;&amp;#93;&lt;/span&gt;}&quot; heartbeat-frequency=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.heartbeatFrequency&amp;#39;&amp;#93;&lt;/span&gt;}&quot; min-heartbeat-frequency=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.minHeartbeatFrequency&amp;#39;&amp;#93;&lt;/span&gt;}&quot; heartbeat-connect-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.heartbeatConnectTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot; heartbeat-socket-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.heartbeatSocketTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot;/&amp;gt;&lt;br/&gt;
&amp;lt;/mongo:mongo-client&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;mongo:db-factory dbname=&quot;tpfdf&quot; mongo-ref=&quot;mongo&quot;/&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;mongo:mapping-converter id=&quot;mongoConverter&quot; base-package=&quot;com.sabre.checkin.connector.tpfdf.converter.mongo&quot;&amp;gt; &lt;br/&gt;
&amp;lt;mongo:custom-converters base-package=&quot;com.sabre.checkin.connector.tpfdf.converter.mongo&quot;/&amp;gt;&amp;lt;/mongo:mapping-converter&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;bean id=&quot;mongoTemplate&quot; class=&quot;org.springframework.data.mongodb.core.MongoTemplate&quot;&amp;gt; &amp;lt;constructor-arg name=&quot;mongoDbFactory&quot; ref=&quot;mongoDbFactory&quot;/&amp;gt; &amp;lt;constructor-arg ref=&quot;mongoConverter&quot;/&amp;gt;&amp;lt;/bean&amp;gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="1986830" author="jeff.yemin" created="Mon, 27 Aug 2018 18:43:52 +0000"  >&lt;p&gt;Ramesh, the only way to force it would be to set the maximum connection pool size to one, but that would mean MongoClient wouldn&apos;t have any concurrency.  A few further questions:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;What server version are you using? Looking at the error code in master, error code 35 maps to something that doesn&apos;t make sense in this context: &lt;a href=&quot;https://docs.google.com/a/10gen.com/document/d/14hoL-vVUHqXYr0eRXqFdEE3iAV3oXZpT8hUqpS1mfGw/edit?pli=1&amp;amp;disco=AAAACCkmsf4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.google.com/a/10gen.com/document/d/14hoL-vVUHqXYr0eRXqFdEE3iAV3oXZpT8hUqpS1mfGw/edit?pli=1&amp;amp;disco=AAAACCkmsf4&lt;/a&gt;, so I want to look at the error codes defined for the server version that you&apos;re actually using.&lt;/li&gt;
	&lt;li&gt;Can you confirm that you can observe this error even when not using a load balancer?  If so, what is the server topology (sharded, replset, standalone) and connection string you&apos;re using to test that scenario?&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="1986763" author="pitani" created="Mon, 27 Aug 2018 18:06:50 +0000"  >&lt;p&gt;Hi Jeff, Reg. &quot;Query failed with error code 35 and error message&quot;. I have one question..&lt;/p&gt;

&lt;p&gt;Z/TPF Mongo Team claims that above error happens if the find and get more are on different connections. Is there a way to force Original Find and GetMore use same mongo connection? Will @Transactional work or any other solution?&lt;/p&gt;</comment>
                            <comment id="1985962" author="jeff.yemin" created="Mon, 27 Aug 2018 01:12:31 +0000"  >&lt;p&gt;If a killCursors message is being sent from a CleanCursors thread, it means that the cursor was not closed by the application (e.g., via a call to DBCursor.close). &lt;/p&gt;


</comment>
                            <comment id="1985954" author="pitani" created="Mon, 27 Aug 2018 00:23:12 +0000"  >&lt;p&gt;We have configured only one server(F5 Load Balancer) in spring context XML file. There is no replica Set. This F5 load balancer server&#160; talks to 2 ZTPF mongo servers behind.&#160;Even if we hit single ZTPF mongo server directly with out going through F5 Load Balancer, We have this error.&#160;&lt;/p&gt;

&lt;p&gt;&amp;lt;mongo:mongo-client host=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.host&amp;#39;&amp;#93;&lt;/span&gt;}&quot; port=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.port&amp;#39;&amp;#93;&lt;/span&gt;}&quot; credentials=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.credentials&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&amp;gt;&lt;br/&gt;
 &amp;lt;mongo:client-options connections-per-host=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.connectionsPerHost&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 threads-allowed-to-block-for-connection-multiplier=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.threadsAllowedToBlockForConnectionMultiplier&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 connect-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.connectTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 max-wait-time=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.maxWaitTime&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 socket-keep-alive=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.socketKeepAlive&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 socket-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.socketTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 max-connection-idle-time=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.maxConnectionIdleTime&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 max-connection-life-time=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.maxConnectionLifeTime&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 heartbeat-frequency=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.heartbeatFrequency&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 min-heartbeat-frequency=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.minHeartbeatFrequency&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 heartbeat-connect-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.heartbeatConnectTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot;&lt;br/&gt;
 heartbeat-socket-timeout=&quot;#{ckiMongoProperties&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mongo.heartbeatSocketTimeout&amp;#39;&amp;#93;&lt;/span&gt;}&quot;/&amp;gt;&lt;br/&gt;
&amp;lt;/mongo:mongo-client&amp;gt;&lt;/p&gt;</comment>
                            <comment id="1985951" author="jeff.yemin" created="Mon, 27 Aug 2018 00:11:21 +0000"  >&lt;p&gt;Yes, there is no requirement that a GetMore request uses the same ConnectionId as the previous ones for a given query.  The only requirement is that it routes it to the same server.  Are you seeing any evidence that the GetMore is routed to a different server address?&lt;/p&gt;</comment>
                            <comment id="1985912" author="pitani" created="Sun, 26 Aug 2018 19:06:35 +0000"  >&lt;p&gt;Hi Jeff, I have observed something in my log file(ErrorLog1.txt) related to error &quot;Query failed with error code 35 and error message &apos;&apos;.&lt;/p&gt;

&lt;p&gt;This&#160; ErrorLog1.txt contains&#160;log messages related to the same transaction. If you look at lines 2 and 4. It&#160;has different ConnectionId Value. 1st line is Mongo query with In clause of 150 addresses. Mongo driver cursor decided to use Get More documents multiple times. 1st time, request&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/194737/194737_ErrorLog1.txt&quot; title=&quot;ErrorLog1.txt attached to JAVA-2945&quot;&gt;ErrorLog1.txt&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; used Connection Id:12, 2nd-time GetMore used&#160;Connection Id:14.&lt;/p&gt;

&lt;p&gt;When I saw successful transactions, It used same connection Id value for 1st time as well as 2nd time(Get More), I am not seeing any problem.&lt;/p&gt;

&lt;p&gt;If the 2nd time (Get More) used different ConnectionId value, then we have the error &quot;Query failed with error code 35 and error message &apos;&apos;. In TPF Mainframe logs error is &quot;MONG0035E 09.51.26 Cursor ID 1 passed on the request is not valid or is not an active cursor.&quot;&lt;/p&gt;

&lt;p&gt;Do you know why 2nd time (GetMore) is using different ConnectionId value compared to 1st one?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="1985532" author="jeff.yemin" created="Fri, 24 Aug 2018 21:05:05 +0000"  >&lt;p&gt;Hi Ramesh,&lt;/p&gt;

&lt;p&gt;I understand your question, and my requests are attempting to prove your hypotheses.  The command monitoring events, in particular the ConnectionId, will tell us that the two requests are actually using the same connection.  The thread dump will prove that the request is actually waiting for a socket read to complete, and the server logs may shed light on whether the second request actually arrived at the server.&lt;/p&gt;

&lt;p&gt;Generally, if a driver receives a response to a request, as it appeared to here (it&apos;s reporting error code 35), then it assumes the socket is still in a good state and just returns it to the pool.  It&apos;s only on an IOException that the connection is forcibly closed by the driver.  &lt;/p&gt;</comment>
                            <comment id="1985514" author="pitani" created="Fri, 24 Aug 2018 20:54:25 +0000"  >&lt;p&gt;Hi Jeff,&lt;/p&gt;

&lt;p&gt;We will try command listener with mongo java driver 3.5.0.&lt;/p&gt;

&lt;p&gt;ZTPF has mongo interface and the&#160;Client application(Java) is using Mongo Java driver(3.5.0) to communicate to ZTPF system using Mongo interface. So the 1st error(Query failed with error code 35 and error message &apos;&apos; on server) might be related to ZTPF system.&lt;/p&gt;

&lt;p&gt;My question mainly about 2nd&#160;request. 2nd request hung forever and mongo java driver is not timing out after 10 seconds. If Mongo Socket connection went bad after 1st error, why driver is not closing bad connection and why&#160;2nd request using bad mongo connection? How can close this bad connection forcebly? Is there a way to close it?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&#160;&lt;/p&gt;</comment>
                            <comment id="1985467" author="jeff.yemin" created="Fri, 24 Aug 2018 20:28:49 +0000"  >&lt;p&gt;Sorry to hear that you&apos;re having issues with MongoDB using the Java driver.  Are you able to reproduce this error?  If so, a few things that would help us to investigate further:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Add a &lt;a href=&quot;http://mongodb.github.io/mongo-java-driver/3.8/driver/reference/monitoring/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;command listener&lt;/a&gt; to your MongoClient and use it to print out the commands that are sent to the server and the replies that are received&lt;/li&gt;
	&lt;li&gt;Take several thread dump, one minute apart, of the application when it&apos;s in a hanging state&lt;/li&gt;
	&lt;li&gt;Check the server logs for any anomolies&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If you can share all that information with us, we can proceed with an investigation.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="194737" name="ErrorLog1.txt" size="7771" author="pitani" created="Sun, 26 Aug 2018 19:05:16 +0000"/>
                            <attachment id="194789" name="ThreadDump.txt" size="5138" author="pitani" created="Mon, 27 Aug 2018 19:43:04 +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|htwvnj:</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>