AsyncMongoClient._cleanup_cursor needs to be synchronous

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      AsyncMongoClient.cleanup_cursor is a coroutine, making it uncallable from any __die_ methods. This prevents asynchronous cursor classes from correctly cleaning up at GC time. We need to separate out the code path in AsyncMongoClient._cleanup_cursor that allows locks from the lock-free code path in order for async cursors to cleanup. 

      Definition of done

      AsyncMongoClient._cleanup_cursor must be synchronous and not attempt to lock.

      Pitfalls

      Everywhere we use AsyncMongoClient._cleanup_cursor will have to explicitly call the locking or lockless version after this change.

            Assignee:
            Noah Stapp
            Reporter:
            Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: