gortiz opened a new pull request, #19020: URL: https://github.com/apache/pinot/pull/19020
## Description `GrpcSenderBackpressureTest.senderObservesBackpressureFromSlowReceiver` is flaky. It asserted an exact relationship between the send loop's `sendCount` and the `RAW_MESSAGES` stat: ```java assertTrue(rawMessages == sendCount || rawMessages == sendCount + 1, ...); ``` That equality does not hold in general. `sendCount` counts every `send()` call the loop makes, but `RAW_MESSAGES` is only incremented once a block passes the terminated / early-terminated guard inside `GrpcSendingMailbox.sendInternal` — and `SendingMailbox.send(MseBlock.Data)` returns `void`, so the loop cannot tell an aborted attempt from a real send. When the tail of the run interleaves with the watchdog's `cancel()`, one or more attempts bump `sendCount` without incrementing `RAW_MESSAGES`, so `RAW_MESSAGES` legitimately trails `sendCount`. CI hit `rawMessages == sendCount - 1`, which the assertion rejected. ## Fix Replace the exact check with two bounds that hold regardless of how the tail interleaves with the cancel: - **`RAW_MESSAGES <= sendCount + 1`** — each `send()` pushes at most one block through `processAndSend` (one `RAW_MESSAGES` increment), and the cancel adds at most one error EOS. - **`RAW_MESSAGES >= polledCount`** — the receiver cannot poll a block the sender never pushed. `polledCount` is measured independently on the receiver side, so this still guards against `RAW_MESSAGES` not being tracked at all. Test-only change; no production code is touched. ## Testing `mvn -pl pinot-query-runtime -Dtest=GrpcSenderBackpressureTest test` passes; spotless / checkstyle / license checks pass on the module. -- 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]
