-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
When a user does a query and doesn't exhaust the cursor they have to explicitly call kill_cursors:
cursor.send(:kill_cursors)
Otherwise the cursor stays alive on the server for 10 minutes, wasting resources. The Ruby driver should detect this problem in a finalizer for Cursor and automatically send OP_KILL_CURSORS or the killCursors command to the server, possibly asynchronously.
This is especially important if the user has explicitly disabled cursor timeout as there is no way to discover open cursor ids on the server.
In the mean time, the tutorial should be updated to cover this case, showing the right way to do, for example, a find one.