We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca1f335 commit 1cb4b30Copy full SHA for 1cb4b30
driver-core/src/main/com/mongodb/operation/QueryBatchCursor.java
@@ -39,6 +39,7 @@ class QueryBatchCursor<T> implements BatchCursor<T> {
39
private final ConnectionSource connectionSource;
40
private int batchSize;
41
private ServerCursor serverCursor;
42
+ private boolean killed;
43
private List<T> nextBatch;
44
private int count;
45
private boolean closed;
@@ -228,8 +229,9 @@ private void killCursor() {
228
229
}
230
231
private void killCursor(final Connection connection) {
- if (serverCursor != null) {
232
+ if (serverCursor != null && !killed) {
233
connection.killCursor(asList(serverCursor.getId()));
234
+ killed = true;
235
236
237
0 commit comments