You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "ankitsultana (via GitHub)" <gi...@apache.org> on 2023/03/15 08:28:19 UTC

[GitHub] [pinot] ankitsultana commented on a diff in pull request #10425: [multistage] Handle Stream Cancellations for Unstarted Streams

ankitsultana commented on code in PR #10425:
URL: https://github.com/apache/pinot/pull/10425#discussion_r1136689520


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/GrpcSendingMailbox.java:
##########
@@ -84,14 +93,15 @@ public boolean isInitialized() {
   public void cancel(Throwable t) {
     if (_initialized.get() && !_statusObserver.isFinished()) {
       LOGGER.warn("GrpcSendingMailbox={} cancelling stream", _mailboxId);
-      try {
-        _mailboxContentStreamObserver.onError(Status.fromThrowable(
-            new RuntimeException("Cancelled by the sender")).asRuntimeException());
-      } catch (Exception e) {
-        // TODO: We don't necessarily need to log this since this is relatively quite likely to happen. Logging this
-        //  anyways as info for now so we can see how frequently this happens.
-        LOGGER.info("Unexpected error issuing onError to MailboxContentStreamObserver: {}", e.getMessage());
-      }
+      DELAYED_CANCEL_SCHEDULER.schedule(() -> {
+        try {
+          _mailboxContentStreamObserver.onError(Status.CANCELLED.asRuntimeException());

Review Comment:
   Changed this to simply cancelled since when sender issues onError, a rst_stream packet is sent on the stream and no additional data is sent to the receiver. In other words, receiver only sees a cancellation on its end.
   
   However when a server calls its outbound onError then the trailers have information about the Status which contains the exception message, so in those cases we should continue to pass the detailed Status.



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