Legacy cursor cleaner still uses OP_KILL_CURSORS

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.8.0
    • Affects Version/s: None
    • Component/s: Legacy API, Wire Protocol
    • None
    • None
    • Fully Compatible
    • Java Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Creating this issue for discoverability.  It was already fixed in the 4.8.0 release in scope of JAVA-4297, but it's difficult to find due to the fix for it being buried in a tangentially-related Git commit and Jira issue.

      The bug is that, despite the driver using OP_MSG and the killCursors command in the standard cursor code path, there was another code path in the legacy com.mongodb.MongoClient API that used the deprecated OP_KILL_CURSORS wire protocol message to implement cleanup of DBCursor instances that were not properly closed by the application and subsequently became eligible for garbage collection. 

      This did not cause any problems until the MongoDB 6.0 release, where support for the deprecated wire protocol was removed from the server, and upon receipt of an unsupported message, the server closes the connection.  For applications with many leaked cursors, this connection churn can cause application instability.

      Link to fix: https://github.com/mongodb/mongo-java-driver/commit/c47ed8cbfe54fbd1b9f5ce8974be1b3c7dfe81bd#diff-9edd83ced1b6f12502db95a96af13ed57e647efd84d2ddf5d040af4a653fb1edL836

            Assignee:
            Unassigned
            Reporter:
            Jeffrey Yemin
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: