BewareMyPower commented on a change in pull request #12343:
URL: https://github.com/apache/pulsar/pull/12343#discussion_r728730295



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
##########
@@ -466,11 +466,17 @@ public void flush() {
             this.lock.writeLock().lock();
             try {
                 flushAsync(cnx);
+            } catch (Exception e) {
+                log.error("[{}] Cannot flush pending acks, exception: ", 
consumer, e);
             } finally {
                 this.lock.writeLock().unlock();
             }
         } else {
-            flushAsync(cnx);
+            try {
+                flushAsync(cnx);
+            } catch (Exception e) {
+                log.error("[{}] Cannot flush pending acks, exception: ", 
consumer, e);
+            }

Review comment:
       For this PR, the key point is that `lastCumulativeAck` might be recycled 
and then the `messageId` field is `null`. I think the fix for `flushAsync` is 
enough. But if `flush` is the critical path that cannot tolerate any exception, 
I think it's better to catch `Throwable` instead of `Exception`.




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