You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/12/13 18:37:57 UTC

[GitHub] [pinot] agavra commented on a diff in pull request #9969: [multistage] [bugfix] Throw error when GrpcMailbox receiving buffer is full

agavra commented on code in PR #9969:
URL: https://github.com/apache/pinot/pull/9969#discussion_r1047585319


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/MailboxContentStreamObserver.java:
##########
@@ -93,7 +105,19 @@ public void onNext(Mailbox.MailboxContent mailboxContent) {
 
     if (!mailboxContent.getMetadataMap().containsKey(ChannelUtils.MAILBOX_METADATA_BEGIN_OF_STREAM_KEY)) {
       // when the receiving end receives a message put it in the mailbox queue.
-      _receivingBuffer.offer(mailboxContent);
+      // TODO: pass a timeout to _receivingBuffer.
+      if (!_receivingBuffer.offer(mailboxContent)) {

Review Comment:
   from the documentation:
   ```
   This API is asynchronous, so methods may return before the operation
    completes. The API provides no guarantees for how quickly an operation 
   will complete, so utilizing flow control via ClientCallStreamObserver 
   and ServerCallStreamObserver to avoid excessive buffering is recommended 
   for streaming RPCs. gRPC's implementation of onError() on client-side 
   causes the RPC to be cancelled and discards all messages, so completes 
   quickly.
   
   gRPC guarantees it does not block on I/O in its implementation, 
   but applications are allowed to perform blocking operations in 
   their implementations. However, doing so will delay other callbacks 
   because the methods cannot be called concurrently.
   ```
   
   If we block here, I think GRPC will just buffer on its end



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org