Skip to content

Commit

Permalink
IGNITE-23299 Fix inflights tracking for RO transactions on cursor clo…
Browse files Browse the repository at this point in the history
…se when transaction is rolling back (#4464)
  • Loading branch information
AMashenkov authored Sep 27, 2024
1 parent ac86966 commit a8ca579
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,11 @@ private void scanBatch(int n) {

inflightBatchRequestTracker.onRequestBegin();

retrieveBatch(scanId, n).thenAccept(binaryRows -> {
CompletableFuture<Collection<T>> retriveBatchFuture = retrieveBatch(scanId, n);
retriveBatchFuture.whenComplete((batch, err) -> inflightBatchRequestTracker.onRequestEnd()).thenAccept(binaryRows -> {
assert binaryRows != null;
assert binaryRows.size() <= n : "Rows more then requested " + binaryRows.size() + " " + n;

inflightBatchRequestTracker.onRequestEnd();

binaryRows.forEach(subscriber::onNext);

if (binaryRows.size() < n) {
Expand All @@ -197,8 +196,6 @@ private void scanBatch(int n) {
}
}
}).exceptionally(t -> {
inflightBatchRequestTracker.onRequestEnd();

cancel(t, false);

return null;
Expand Down

0 comments on commit a8ca579

Please sign in to comment.