TailableIterator can time out if kept alive for longer than MongoDB cursor timeout
Opened this issue · 0 comments
laserval commented
It seems that a TailableIterator that is kept alive for longer than the default MongoDB cursor timeout of 10 minutes, will be garbage collected in the MongoDB server. See https://jira.mongodb.org/browse/SERVER-12200
One case this will happen is if some service is listening to processed, failed or discarded documents in the oldDocuments
collection.
Some solutions:
- Set the MongoDB option
NOTIMEOUT
on the tailable cursor - Recreate the cursor if it fails
- Await fixes to timeouts in MongoDB and mongo-java-driver and require newer versions of both (https://jira.mongodb.org/browse/SERVER-8188, https://jira.mongodb.org/browse/SERVER-12200)
Related issue concerning tailable and awaitdata: https://jira.mongodb.org/browse/JAVA-1091