Jackie-Jiang commented on code in PR #16903:
URL: https://github.com/apache/pinot/pull/16903#discussion_r2427009023


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/MailboxContentObserver.java:
##########
@@ -49,6 +50,7 @@ public class MailboxContentObserver implements 
StreamObserver<MailboxContent> {
   private final MailboxService _mailboxService;
   private final StreamObserver<MailboxStatus> _responseObserver;
   private final List<ByteBuffer> _mailboxBuffers = 
Collections.synchronizedList(new ArrayList<>());
+  private boolean _closedStream = false;

Review Comment:
   > It doesn't have to be volatile given StreamObservers should be 
thread-compatible. Given we never manually call methods on this class but 
instead it is GRPC the one that calls it, it is safe to assume 
thread-compatibility is honored.
   
   I've been confusing about what thread-compatible stands for. Does that mean 
we don't need to sync on memory accessed by different threads? I.e. we don't 
need `_mailboxBuffers` to be synchronized, and `_mailbox` to be `volatile`?



-- 
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]

Reply via email to