Skip to content

Commit

Permalink
Removed cleaning of unclosed result set
Browse files Browse the repository at this point in the history
  • Loading branch information
alex268 committed Sep 30, 2024
1 parent f7435de commit 96ccf40
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions jdbc/src/main/java/tech/ydb/jdbc/context/StreamQueryResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,15 @@ private void closeResultSet(int index) throws SQLException {
}
}

private boolean isStreamStopped() {
private void checkStream() {
if (!resultClosed) {
return false;
return;
}

if (!streamFuture.isDone() && streamCancelled.compareAndSet(false, true)) {
LOGGER.log(Level.FINE, "Stream cancel");
stopRunnable.run();
}

return true;
}

@Override
Expand Down Expand Up @@ -311,10 +309,7 @@ public void cleanQueue() {
public void addResultSet(ResultSetReader rsr) {
try {
do {
if (isStreamStopped()) {
close();
return;
}
checkStream();
} while (!readers.offer(rsr, 100, TimeUnit.MILLISECONDS));
} catch (InterruptedException ex) {
if (streamFuture.completeExceptionally(ex)) {
Expand Down

0 comments on commit 96ccf40

Please sign in to comment.