-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:CentOS 7 with sharded cluster running mongo 3.4
Hello,
We are getting MongoCursorNotFoundException almost immediately (about 1-2 seconds) after running a find query. To give a little more info, in our code we run a find and then grab the iterator from the FindIterable and run through the items in a while loop.
I put in some logs and found that after the find is run, while it's looping through, after 01.670seconds, it threw the exception below. 10 minutes after this occurs, in the mongos logs the cursor is closed for idle timeout.
The only thing I can think of for a possible cause is, we have 6 machines that have mongos running and each of the application servers use a round robin styled DNS resolver to resolve the mongos URL. Would this setup cause a problem for the mongo connection?
Stacktrace:
Caused by: com.mongodb.MongoCursorNotFoundException: Query failed with error code -5 and error message 'Cursor 692999830626020539 not found on server mongos:27276' on server mongos:27276
at com.mongodb.operation.QueryHelper.translateCommandException(QueryHelper.java:27)
at com.mongodb.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:213)
at com.mongodb.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:103)
at com.mongodb.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:46)
Please let me know if you need any additional information.