davecromberge opened a new pull request, #19329: URL: https://github.com/apache/pinot/pull/19329
An error EOS drains the queued data blocks and makes every parked sender give up. While those offers are still in flight, `poll` returns `null` and asks the reader to wait for them (`ReceivingMailbox.java:657`). But a sender that gives up returns `ALREADY_TERMINATED` without notifying, and the reader coalesces notifications into a single slot, so the EOS notification cannot stand in for the missing one. Nothing wakes the reader again: it blocks until the query deadline and the query reports `EXECUTION_TIMEOUT` instead of the error that actually caused it. Reachable whenever the queue is full and senders are parked when an error EOS or a cancellation arrives. The same gap swallows the `TimeoutException` and `InterruptedException` paths out of `offerDataToBuffer`, which unwind into an `offerEos` that is rejected as already terminated. `offerDataToBuffer` now notifies on every exit path when it is the last pending offer and the upstream has finished — exactly the condition `poll` waits on. The lock is held there, since `awaitNanos` reacquires it on all three exits. On the success path this duplicates the notification from `offerData`, which is harmless because notifications coalesce. The test asserts the notification count rather than blocking on a read, so it is deterministic: the wake-up is delivered when the last pending offer completes, whether or not the reader managed to poll first. It fails on master with `expected [3] but found [2]`. Supersedes #19323, which proposed a fix for a lost wake-up at reader registration. That one turned out to be unreachable: registration precedes the reader's first scan, and the scan makes the dropped notification redundant. Thanks to @yashmayya for pushing back on it and pointing at this path instead. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
