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

Driver can exhaust query pool if limit is reached on the first batch of a query

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.3, 3.1.0
    • Affects Version/s: 3.0.2
    • Component/s: Query Operations
    • Labels:
      None

      When a user specifies a limit on a find operation, and that limit is reached on the initial batch returned from OP_QUERY, the driver immediately attempts to kill the cursor via OP_KILL_CURSOR after reading the initial batch. The problem is that it does so by pulling another connection from the pool before the connection that was used for the OP_QUERY has been released back to the pool. This effectively doubles the number of connections required for find operations that specify a limit, and in the worst case can cause starvation, where all threads are waiting for connections but none are available.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: