Skip to content

Commit

Permalink
Improve handling of closed iterators.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwenzel committed Jul 17, 2024
1 parent 04d57ac commit c2adef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ public void close() {
}
}
} finally {
if (readLock != null) {
readLock.release();
}
readLock.release();
closed = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ public boolean hasNext() throws QueryEvaluationException {
return false;
}
next = computeNext();
if (isClosed()) {
// close underlying iterator if iteration was closed asynchronously (due to query timeout)
handleClose();
next = null;
}
}
return next != null;
}
Expand Down

0 comments on commit c2adef2

Please sign in to comment.