[SERVER-5816] Add command to get a list of open cursors Created: 10/May/12  Updated: 09/Jul/16  Resolved: 23/Jan/13

Status: Closed
Project: Core Server
Component/s: Admin, Querying
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: admin, api, cursors
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-3090 Add the ability to list open cursors Closed
Related
related to SERVER-1919 cursor info option to get detailed in... Closed
Participants:

 Comments   
Comment by Githook User [ 07/Apr/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: PHPC-225: Test Cursor::isDead() and kill on destruct

Testing for kill on destruct is based on PyMongo (see: https://jira.mongodb.org/browse/SERVER-5816?focusedCommentId=201245).
Branch: master
https://github.com/10gen-labs/mongo-php-driver-prototype/commit/e2e9d89cb2ed267537f56ea39af3d0a0b76e4ce6

Comment by Scott Hernandez (Inactive) [ 23/Jan/13 ]

dup of SERVER-3090

Comment by A. Jesse Jiryu Davis [ 28/Nov/12 ]

This is crucial, it turns out, for driver testing. A common driver bug is to fail to close an open cursor that's incompletely iterated:

for doc in collection.find():
    break

The code above needs to send a close-cursor message to the server once the cursor object goes out of scope.

Testing that this actually happens in unittests is hard. One technique PyMongo uses is to count the number of open cursors with serverStatus command, run the test, and assert that the number of open cursors has returned to its former value.

When connected to an RS or a Master, though, replication cursors come and go, and make these cursor-counting tests unreliable.

Comment by Spencer Brody (Inactive) [ 10/May/12 ]

Potentially. At the minimum it would need to return a list of open cursor ids that could be looked up using the command from SERVER-1919. Or it could return that information directly.

Comment by Scott Hernandez (Inactive) [ 10/May/12 ]

Is the goal here is to list the stats from the cursors including the position, query+opts, time-open/last-access, etc.

Generated at Thu Feb 08 03:09:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.