eolivelli commented on a change in pull request #10163:
URL: https://github.com/apache/pulsar/pull/10163#discussion_r610484938



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -453,6 +455,7 @@ public UnAckedMessageTracker getUnAckedMessageTracker() {
         try {
             return internalBatchReceiveAsync().get();
         } catch (InterruptedException | ExecutionException e) {
+            Thread.currentThread().interrupt();

Review comment:
       no, we have to call "Thread.currentThread().interrupt()" only while 
catching InterruptedException.
   
   I suggest you to add some Util method and use it everywhere, this way we can 
still use multi catch
   
   ```
   public static void handleInterruptedException(Throwable t) {
        if (t instanceof InterruptedException) {
              Thread.currentThread().interrupt();     
       }
   }
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to