-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OperationFailure invalid cursor id #7
Comments
Might be easiest to pass through the pymongo Collection.find's timeout keyword argument for long-expected-runtime queries. Do we close these safely? I'm not sure if it's possible to keep re-create a cursor without knowing the database state, although perhaps if we know the number of returned values we can just slice by that. This would cause duplicates though, where the database has been modified during the evidently long-running query and that would be a far greater concern. Mongo is already kind enough to return duplicates when iterating though and modifying unsorted cursors. If it were possible for mongorm to do 100% reliable cleanup (even when killed, etc), we could make all queries not timeout, but this seems like small bugs could kill the database server, although it's not that much worse than memory management in C. |
Timeout sounds like it would work. I'm not too familiar with mongorm/db - would all the connections get closed when the python interpreter (where I'm running this command) exits? |
Yes, mongo performs cleanups. The most mongorm can do really is allow setting the timeout value and/or re-raise this exception as a mongorm exception. |
Closing since the above 2 issues are the best you can expect from a database abstraction layer. |
Fix in operator not working with references
It looks like the cursor needs to be refreshed or this exception should be caught at some stage instead of bubbling up to the application.
The text was updated successfully, but these errors were encountered: