Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1104

Automatically kill cursors when necessary

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.0
    • 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.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: