You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/03/30 15:31:49 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #10088: Avoid spammy logs in case of BK problems

merlimat commented on a change in pull request #10088:
URL: https://github.com/apache/pulsar/pull/10088#discussion_r604206487



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -1245,7 +1246,8 @@ protected void handleProducer(final CommandProducer cmdProducer) {
                                 cause = new TopicNotFoundException("Topic Not Found.");
                             }
 
-                            if (!(cause instanceof ServiceUnitNotReadyException)) {
+                            if (!(cause instanceof ServiceUnitNotReadyException)
+                                && (!Exceptions.isExceptionPresentInChain(cause, ManagedLedgerException.class))) {

Review comment:
       The utility method could also take care of checking for `ServiceUnitNotReadyException`

##########
File path: pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Exceptions.java
##########
@@ -48,4 +48,15 @@ public static String toString(Exception ex) {
         return sw.toString();
     }
 
+    public static boolean isExceptionPresentInChain(Throwable error, Class type) {

Review comment:
       We could allow for multiple types here:
   
   ```suggestion
       public static boolean areExceptionsPresentInChain(Throwable error, Class types...) {
   ```




-- 
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:
users@infra.apache.org