gortiz commented on code in PR #14507: URL: https://github.com/apache/pinot/pull/14507#discussion_r1888391805
########## pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/exchange/BlockExchange.java: ########## @@ -84,8 +92,19 @@ public boolean send(TransferableBlock block) if (block.isSuccessfulEndOfStreamBlock()) { // Send metadata to only one randomly picked mailbox, and empty EOS block to other mailboxes int numMailboxes = _sendingMailboxes.size(); - int mailboxIdToSendMetadata = ThreadLocalRandom.current().nextInt(numMailboxes); - assert block.getQueryStats() != null; + int mailboxIdToSendMetadata; + if (block.getQueryStats() != null) { + mailboxIdToSendMetadata = ThreadLocalRandom.current().nextInt(numMailboxes); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Sending EOS metadata. Only mailbox #{} will get stats", mailboxIdToSendMetadata); + } Review Comment: Remember that this verbose way to log (first check then log) is used to avoid the unnecessary varargs array allocation in `LOGGER.trace(string, object...)` when the log is not going to be printed. Given this is the hotpath, we are extra careful trying to not include extra allocations. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org