<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:12:58 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>[SERVER-6872] scoped connection not being return to the pool</title>
                <link>https://jira.mongodb.org/browse/SERVER-6872</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;mongodb configuration: 2shards, 3instances each, 3 config servers, remote mongos, 52mbit network between mongos and mongod, 1gbit between mongod&apos;s&lt;/p&gt;

&lt;p&gt;I&apos;m trying to retrieve data from mongodb via single .find() query in mongo console.&lt;br/&gt;
code:&lt;br/&gt;
var i=0;&lt;br/&gt;
var cursor=db.load.find();&lt;br/&gt;
while(cursor.hasNext())&lt;/p&gt;
{cursor.next();i++;}
&lt;p&gt;;print&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/information.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;;&lt;/p&gt;

&lt;p&gt;while attempts to do so on the local machine are always successful, the query on remote mongos fails repeatable on the same entity.&lt;br/&gt;
entities length seems to be homogeneous.&lt;/p&gt;

&lt;p&gt;console output:&lt;br/&gt;
1670457&lt;br/&gt;
getMore: cursor didn&apos;t exist on server, possible restart or timeout?&lt;/p&gt;

&lt;p&gt;db.load.count():&lt;br/&gt;
3236686&lt;/p&gt;

&lt;p&gt;db.stats():&lt;/p&gt;

&lt;p&gt;mongos&amp;gt; db.stats(1024*1024);&lt;br/&gt;
{&lt;br/&gt;
	&quot;raw&quot; : {&lt;br/&gt;
		&quot;rset01/load1ft:27017,load2ft:27017,load3ft:27017&quot; : &lt;/p&gt;
{
			&quot;db&quot; : &quot;test&quot;,
			&quot;collections&quot; : 4,
			&quot;objects&quot; : 1670511,
			&quot;avgObjSize&quot; : 5729.003803027936,
			&quot;dataSize&quot; : 9127,
			&quot;storageSize&quot; : 9734,
			&quot;numExtents&quot; : 40,
			&quot;indexes&quot; : 4,
			&quot;indexSize&quot; : 376,
			&quot;fileSize&quot; : 16313,
			&quot;nsSizeMB&quot; : 16,
			&quot;ok&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;rset02/load1gt:27017,load2gt:27017,load3gt:27017&quot; : &lt;/p&gt;
{
			&quot;db&quot; : &quot;test&quot;,
			&quot;collections&quot; : 3,
			&quot;objects&quot; : 1566193,
			&quot;avgObjSize&quot; : 5903.711271854746,
			&quot;dataSize&quot; : 8818,
			&quot;storageSize&quot; : 9223,
			&quot;numExtents&quot; : 39,
			&quot;indexes&quot; : 2,
			&quot;indexSize&quot; : 348,
			&quot;fileSize&quot; : 14266,
			&quot;nsSizeMB&quot; : 16,
			&quot;ok&quot; : 1
		}
&lt;p&gt;	},&lt;br/&gt;
	&quot;objects&quot; : 3236704,&lt;br/&gt;
	&quot;avgObjSize&quot; : 0.005544220293236576,&lt;br/&gt;
	&quot;dataSize&quot; : 17945,&lt;br/&gt;
	&quot;storageSize&quot; : 18957,&lt;br/&gt;
	&quot;numExtents&quot; : 79,&lt;br/&gt;
	&quot;indexes&quot; : 6,&lt;br/&gt;
	&quot;indexSize&quot; : 724,&lt;br/&gt;
	&quot;fileSize&quot; : 30579,&lt;br/&gt;
	&quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;




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

&lt;p&gt;Mon Aug 27 18:49:16 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; want cursor : 1975918310978336011&lt;br/&gt;
Mon Aug 27 18:49:16 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; CursorCache::get id: 1975918310978336011&lt;br/&gt;
Mon Aug 27 18:49:16 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; scoped connection to load1ft:27017 not being returned to the pool&lt;br/&gt;
Mon Aug 27 18:49:16 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; AssertionException while processing op type : 2005 to : testing.load :: caused by :: 13127 getMore: cursor didn&apos;t exist on server, possible restart or timeout?&lt;/p&gt;</description>
                <environment>mongodb 2.0.6</environment>
        <key id="48188">SERVER-6872</key>
            <summary>scoped connection not being return to the pool</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="3">Duplicate</resolution>
                                        <assignee username="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="gabol">Anton V. Volokhov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Aug 2012 15:21:02 +0000</created>
                <updated>Fri, 15 Feb 2013 15:06:10 +0000</updated>
                            <resolved>Sun, 2 Sep 2012 01:20:19 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="159690" author="gabol" created="Sat, 1 Sep 2012 16:24:37 +0000"  >&lt;p&gt;they say, it is related to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-5157&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-5157&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="157904" author="gabol" created="Wed, 29 Aug 2012 12:07:33 +0000"  >&lt;p&gt;output from mongos during the last run:&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; Request::process ns: test.$cmd msg id:6 attempt: 0&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; single query: test.$cmd  { count: &quot;load&quot;, query: {} }  ntoreturn: 1 options : 4&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;  have to set shard version for conn: 0x23433e0 ns:test.load my last seq: 0  current: 2 version: 86|0 manager: 0x7f0694004c90&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;     setShardVersion  rset01 load1ft:27017  test.load  &lt;/p&gt;
{ setShardVersion: &quot;test.load&quot;, configdb: &quot;load1ft:27018&quot;, version: Timestamp 86000|0, serverID: ObjectId(&apos;503cb063fed7a82fa1518d62&apos;), shard: &quot;rset01&quot;, shardHost: &quot;rset01/load1ft:27017,load2ft:27017,load3ft:27017&quot; }
&lt;p&gt; 0x23433e0&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;       setShardVersion success: &lt;/p&gt;
{ oldVersion: Timestamp 0|0, ok: 1.0 }
&lt;p&gt;Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;  have to set shard version for conn: 0x2344d20 ns:test.load my last seq: 0  current: 2 version: 86|1 manager: 0x7f0694004c90&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;     setShardVersion  rset02 load2gt:27017  test.load  &lt;/p&gt;
{ setShardVersion: &quot;test.load&quot;, configdb:load1ft:27018&quot;, version: Timestamp 86000|1, serverID: ObjectId(&apos;503cb063fed7a82fa1518d62&apos;), shard: &quot;rset02&quot;, shardHost: &quot;rset02/load1gt:27017,load2gt:27017,load3gt:27017&quot; }
&lt;p&gt; 0x2344d20&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;       setShardVersion success: &lt;/p&gt;
{ oldVersion: Timestamp 0|0, ok: 1.0 }
&lt;p&gt;Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; slave &apos;&apos; is not initialized or invalid&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; dbclient_rs getSlave rset02/load1gt:27017,load2gt:27017,load3gt:27017&lt;br/&gt;
Tue Aug 28 20:06:20 BackgroundJob starting: ConnectBG&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; Request::process ns: test.load msg id:7 attempt: 0&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; shard query: test.load  { query: {}, $snapshot: true }&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;  shard query servers: 2&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; ParallelSortClusteredCursor::init server:rset01/load1ft:27017,load2ft:27017,load3ft:27017 ns:test.load query:{ query: {}, $snapshot: true } _fields:{} options: 20&lt;br/&gt;
Tue Aug 28 20:06:20 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; ParallelSortClusteredCursor::init server:rset02/load1gt:27017,load2gt:27017,load3gt:27017 ns:test.load query:{ query: {}, $snapshot: true } _fields:{} options: 20&lt;br/&gt;
Tue Aug 28 20:06:21 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;    cursor type: ParallelSort&lt;br/&gt;
Tue Aug 28 20:06:21 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;      hasMore: 1 sendMore: 1 cursorMore: 1 ntoreturn: 0 num: 100 wouldSendMoreIfHad: 1 id:3399191084891024289 totalSent: 0&lt;br/&gt;
Tue Aug 28 20:06:22 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; storing cursor : 3399191084891024289&lt;br/&gt;
...&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; Request::process ns: test.load msg id:5864 attempt: 0&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; want cursor : 3399191084891024289&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; CursorCache::get id: 3399191084891024289&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;      hasMore: 1 sendMore: 1 cursorMore: 1 ntoreturn: 0 num: 776 wouldSendMoreIfHad: 1 id:3399191084891024289 totalSent: 3235793&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; Request::process ns: test.load msg id:5865 attempt: 0&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; want cursor : 3399191084891024289&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; CursorCache::get id: 3399191084891024289&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt;      hasMore: 0 sendMore: 1 cursorMore: 0 ntoreturn: 0 num: 117 wouldSendMoreIfHad: 1 id:3399191084891024289 totalSent: 3236569&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; Socket recv() conn closed? 127.0.0.1:39734&lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; SocketException: remote: 127.0.0.1:39734 error: 9001 socket exception &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; server &lt;span class=&quot;error&quot;&gt;&amp;#91;127.0.0.1:39734&amp;#93;&lt;/span&gt; &lt;br/&gt;
Tue Aug 28 21:48:46 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn3&amp;#93;&lt;/span&gt; end connection 127.0.0.1:39734&lt;/p&gt;</comment>
                            <comment id="157566" author="gabol" created="Tue, 28 Aug 2012 16:12:24 +0000"  >&lt;p&gt;no, the process wasn&apos;t stopped.&lt;/p&gt;

&lt;p&gt;some more info for previous run:&lt;br/&gt;
1. We never getMore on killed cursor, except the time, when exception occurred.&lt;br/&gt;
2. Last getMore on load1ft was in 18:21&lt;br/&gt;
Mon Aug 27 18:21:50 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn197472&amp;#93;&lt;/span&gt; getmore test.load cursorid:8060402827378091386 nreturned:671 reslen:3861713 4ms&lt;br/&gt;
3. In the interval 18:18 - 18:49 we got data from the second shard.&lt;/p&gt;

&lt;p&gt;this run timing is even more strange:&lt;br/&gt;
Tue Aug 28 16:04:37 &lt;span class=&quot;error&quot;&gt;&amp;#91;clientcursormon&amp;#93;&lt;/span&gt; killing old cursor 5889331906261155351 test.load idle:600254ms&lt;br/&gt;
Tue Aug 28 18:48:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn203588&amp;#93;&lt;/span&gt; getMore: cursorid not found test.load 5889331906261155351&lt;br/&gt;
Tue Aug 28 18:48:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn203588&amp;#93;&lt;/span&gt; getmore test.load cursorid:5889331906261155351 ntoreturn:3 reslen:20 0ms&lt;br/&gt;
and we still asked getMore on this cursor only one time, in 18:48:02&lt;/p&gt;

&lt;p&gt;the rest of log is equal to previous.&lt;/p&gt;</comment>
                            <comment id="157513" author="scotthernandez" created="Tue, 28 Aug 2012 14:57:55 +0000"  >&lt;p&gt;Can you post the server logs from that run?&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Mon Aug 27 18:18:36 [clientcursormon] killing old cursor 6099439472920059228 test.load idle:604000ms&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mem (MB) res:24408 virt:128207 mapped:63717&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Mon Aug 27 18:49:16 [conn197395] getMore: cursorid not found test.load 6099439472920059228&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;These events are very far apart; are you sure that you are not stopping somewhere during your cursor next() loop?&lt;/p&gt;</comment>
                            <comment id="157506" author="gabol" created="Tue, 28 Aug 2012 14:51:59 +0000"  >&lt;p&gt;The same behaviour with your query.&lt;br/&gt;
mongos&amp;gt; print(db.load.find().batchSize(3).itcount());&lt;br/&gt;
1670500&lt;br/&gt;
getMore: cursor didn&apos;t exist on server, possible restart or timeout?&lt;/p&gt;

&lt;p&gt;And same errors on mongod&apos;s&lt;/p&gt;</comment>
                            <comment id="157449" author="scotthernandez" created="Tue, 28 Aug 2012 13:09:05 +0000"  >&lt;p&gt;Please test that with the batchSize; it will return batches from the cursor with 3 docs at a time.&lt;/p&gt;</comment>
                            <comment id="157444" author="gabol" created="Tue, 28 Aug 2012 12:51:22 +0000"  >&lt;p&gt;logs on load1ft&lt;br/&gt;
grep 6099439472920059228 mongodb.log #dead cursor id&lt;/p&gt;

&lt;p&gt;Mon Aug 27 18:18:36 &lt;span class=&quot;error&quot;&gt;&amp;#91;clientcursormon&amp;#93;&lt;/span&gt; killing old cursor 6099439472920059228 test.load idle:604000ms&lt;br/&gt;
mem (MB) res:24408 virt:128207 mapped:63717&lt;br/&gt;
Mon Aug 27 18:49:16 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn197395&amp;#93;&lt;/span&gt; getMore: cursorid not found test.load 6099439472920059228&lt;br/&gt;
Mon Aug 27 18:49:16 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn197395&amp;#93;&lt;/span&gt; getmore test.load cursorid:6099439472920059228 reslen:20 0ms&lt;/p&gt;

&lt;p&gt;Is there any way to increase cursor timeout, or we have to split the data and retrieve it by pieces?&lt;/p&gt;

&lt;p&gt;all instances in rset01 and primary in rset02 got following error in time interval 18:49:15 - 18:49:20&lt;br/&gt;
Mon Aug 27 18:49:18 BackgroundJob starting: ConnectBG&lt;br/&gt;
Mon Aug 27 18:49:19 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn197808&amp;#93;&lt;/span&gt; Socket recv() conn closed? x.x.x.x):53160&lt;br/&gt;
Mon Aug 27 18:49:19 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn197808&amp;#93;&lt;/span&gt; SocketException: remote: x.x.x.x:53160 error: 9001 socket exception &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; server &lt;span class=&quot;error&quot;&gt;&amp;#91;x.x.x.x:53160&amp;#93;&lt;/span&gt; &lt;br/&gt;
Mon Aug 27 18:49:19 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn197808&amp;#93;&lt;/span&gt; end connection x.x.x.x:53160&lt;br/&gt;
primary shard for test database is rset02/&lt;/p&gt;</comment>
                            <comment id="157308" author="scotthernandez" created="Tue, 28 Aug 2012 03:18:39 +0000"  >&lt;p&gt;Are there any messages on the mongod (shards) at this time? This sounds like a cursor timeout (they timeout after 10 minutes of inactivity) in processing the documents in the loop, and that it is related to the network/latency.&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongos&amp;gt; print(db.load.find().batchSize(3).itcount());&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;//Note that itcount does the same thing as your loop; run the line below without the &quot;()&quot; to see&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongos&amp;gt; db.load.find().itcount&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="156966" author="gabol" created="Mon, 27 Aug 2012 16:06:50 +0000"  >&lt;p&gt;well, almost the same entity. +- 1000 in 10 runs.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="31936">SERVER-5157</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 28 Aug 2012 03:18:39 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 24 weeks, 4 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 24 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>gabol</customfieldvalue>
            <customfieldvalue>jmikola@mongodb.com</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrnqm7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrg447:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7571</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrojpr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>