Skip to content

Commit

Permalink
Only check the breaker at the end of the segment if the source is req…
Browse files Browse the repository at this point in the history
…uired
  • Loading branch information
andreidan committed Feb 23, 2025
1 parent 39a0cc0 commit abacdb1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ protected SearchHit nextDoc(int doc) throws IOException {
throw new TaskCancelledException("cancelled");
}
++processedDocs;
if (context.checkRealMemoryCB(accumulatedBytesInLeaf, processedDocs == docsInLeaf, "fetch source")) {
// note that we only check the real memory breaker if we have a source to load
if (context.checkRealMemoryCB(accumulatedBytesInLeaf, (requiresSource && processedDocs == docsInLeaf), "fetch source")) {
// if we checked the real memory breaker, we restart our local accounting
accumulatedBytesInLeaf = 0;
}
Expand Down

0 comments on commit abacdb1

Please sign in to comment.