Skip to content

Commit 64f14e9

Browse files
committed
fix(distributed): drain last operator output in PipelineDriver to prevent infinite loop
The processOnce() loop only passed output between adjacent operator pairs (i to i+1), never calling getOutput() on the last operator. Operators that buffer pages (e.g., PassThroughOperator) would never have their buffer drained, causing isFinished() to never return true and an infinite loop in run().
1 parent dcdeabe commit 64f14e9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

core/src/main/java/org/opensearch/sql/planner/distributed/pipeline/PipelineDriver.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ boolean processOnce() {
164164
}
165165
}
166166

167+
// Drain the last operator's output so it can transition to finished.
168+
// Without this, operators that buffer pages (e.g., PassThroughOperator)
169+
// would never have getOutput() called, preventing isFinished() from
170+
// returning true.
171+
if (!operators.isEmpty()) {
172+
Operator last = operators.get(operators.size() - 1);
173+
Page output = last.getOutput();
174+
if (output != null) {
175+
madeProgress = true;
176+
}
177+
}
178+
167179
return madeProgress;
168180
}
169181

0 commit comments

Comments
 (0)