Model.find().cursor().destroy() does not close the underlying mongodb cursor #14966
Closed
2 tasks done
Labels
Milestone
Prerequisites
Last performant version
Slowed down in version
8.1.1
Node.js version
16.20.2
🦥 Performance issue
When you use streaming API of QueryCursor and you need to
destory
stream for some reason (e.g. the upstream was destoryed too) it won't close the cursor and the cursor and session will hang in memory (activeSessions
)Steps to Reproduce
Expected Behavior
It looks to me that the correct behavior should be — to automatically call
cursor.close()
when the stream is destroyedThe text was updated successfully, but these errors were encountered: