Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3907

AsyncQueryBatchCursor does not release ConnectionSource when closed

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.1
    • Affects Version/s: None
    • Component/s: Reactive Streams
    • None

      AsyncQueryBatchCursor#close does not release its reference to the ConnectionSource. This is not a problem if iteration completes successfully, as the getMore callback releases it when the server cursor is exhausted. But if iteration is interrupted due to error or the cursor is not fully iterated by the application, the reference will never get released. This can cause a leak, as a ConnectionSource can hold a reference to a resource (most likely a ClientSession.

            Assignee:
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: