gortiz commented on code in PR #11205: URL: https://github.com/apache/pinot/pull/11205#discussion_r1277736498
########## pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/ReceivingMailbox.java: ########## @@ -133,4 +152,15 @@ public void cancel() { public int getNumPendingBlocks() { return _blocks.size(); } + + private void notifyReader() { + Reader reader = _reader; + if (reader != null) { Review Comment: To be fair, there is a race condition here. Being paranoid, the following sequence is legal and problematic: 1. The mailbox is created by the sender side 2. A message is sent. But just after `_reader` is read... 3. The reader is registered 4. The reader polls the mailbox and found nothing 5. The reader blocks on the `notEmpty` condition 6. The mailbox executes this line, which is false because when read, _reader was null 7. The message is not sent 8. No more messages are sent by the sender 9. The reader is infinitely waiting for the condition I'll try to fix that next week by adding a lock with an optimistic read, so performance should not be affected -- 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