Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
3.2.2
-
None
Description
Please have a look at following code snipped:
MongoDatabase db = mongoClient.getDatabase("local"); |
MongoCollection<Document> oplogCollection = db.getCollection("oplog.$main"); |
|
|
MongoCursor<Document> cursor = oplogCollection.find(aFilter())
|
.cursorType(CursorType.Tailable)
|
//will throw MongoExecutionTimeoutException after ~ 10s -30s |
.maxTime(300, MILLISECONDS) |
.iterator();
|
|
|
//following code will produce an exception after like 10-30s:
|
cursor.hasNext();
|
I tried to implement this functionality using cursor type=TailableAwait and maxAwaitTile(300, MILLISECONDS) but in such case code was just freezing without any timeout.