ivankelly commented on a change in pull request #11627:
URL: https://github.com/apache/pulsar/pull/11627#discussion_r688340601



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -883,16 +887,21 @@ private void sendFlowPermitsToBroker(ClientCnx cnx, int 
numMessages) {
     public void connectionFailed(PulsarClientException exception) {
         boolean nonRetriableError = 
!PulsarClientException.isRetriableError(exception);
         boolean timeout = System.currentTimeMillis() > subscribeTimeout;
-        if ((nonRetriableError || timeout) && 
subscribeFuture.completeExceptionally(exception)) {
-            setState(State.Failed);
-            if (nonRetriableError) {
-                log.info("[{}] Consumer creation failed for consumer {} with 
unretriableError {}", topic, consumerId, exception);
-            } else {
-                log.info("[{}] Consumer creation failed for consumer {} after 
timeout", topic, consumerId);
+        if (nonRetriableError || timeout) {
+            exception.setPreviousExceptions(previousExceptions);
+            if (subscribeFuture.completeExceptionally(exception)) {
+                setState(State.Failed);
+                if (nonRetriableError) {
+                    log.info("[{}] Consumer creation failed for consumer {} 
with unretriableError {}", topic, consumerId, exception);
+                } else {
+                    log.info("[{}] Consumer creation failed for consumer {} 
after timeout", topic, consumerId);

Review comment:
       it wouldn't add any more information. TimeoutExceptions all come from 
https://github.com/apache/pulsar/blob/05827aeb4b0aa4a1b09a7a122f00a65012bf53a1/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java#L1149
   So the timeout exception message and stack would be exactly the same every 
time.
   
   Also, note that with the non-timeout exception it's not printing the 
stacktrace.




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


Reply via email to