[JAVA-1882] Driver can exhaust query pool if limit is reached on the first batch of a query Created: 08/Jul/15 Updated: 16/Jul/15 Resolved: 10/Jul/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Query Operations |
| Affects Version/s: | 3.0.2 |
| Fix Version/s: | 3.0.3, 3.1.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
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. |
| Comments |
| Comment by Jeffrey Yemin [ 16/Jul/15 ] |
|
Fix is now available in the 3.0.3 release. |
| Comment by Githook User [ 09/Jul/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: When the limit is reached after the initial batch of results of a FindOperation, use the same connection that was used for the initial OP_QUERY to execute the OP_KILL_CURSOR. This will ensure that a thread never attempts to checkout more than one connection at a time. |
| Comment by Githook User [ 08/Jul/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: When the limit is reached after the initial batch of results of a FindOperation, use the same connection that was used for the initial OP_QUERY to execute the OP_KILL_CURSOR. This will ensure that a thread never attempts to checkout more than one connection at a time. |
| Comment by Jeffrey Yemin [ 08/Jul/15 ] |
|
Thanks to robert.j.moore@allanbank.com for identifying this issue while running the YCSB benchmark. |