This is an automated email from the ASF dual-hosted git repository.

alizamus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 032cd85  Silence Stacktrace from Stale Reply Messages (#1460)
032cd85 is described below

commit 032cd85ad40f6ddfc838fd48317a579e761e315f
Author: Neal Sun <[email protected]>
AuthorDate: Wed Oct 21 16:10:03 2020 -0700

    Silence Stacktrace from Stale Reply Messages (#1460)
    
    This commits adds a less verbose (no stacktrace) HelixException
    and raises it for stale reply message cases.
---
 .../src/main/java/org/apache/helix/HelixException.java         | 10 ++++++++++
 .../apache/helix/messaging/handling/AsyncCallbackService.java  |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/helix-common/src/main/java/org/apache/helix/HelixException.java 
b/helix-common/src/main/java/org/apache/helix/HelixException.java
index b4d903d..8a85058 100644
--- a/helix-common/src/main/java/org/apache/helix/HelixException.java
+++ b/helix-common/src/main/java/org/apache/helix/HelixException.java
@@ -30,6 +30,16 @@ public class HelixException extends RuntimeException {
     super(message);
   }
 
+  /**
+   * Create a HelixException that can optionally turn off stack trace. Its 
other characteristics are
+   * the same as a HelixException with a message.
+   * @param message the detail message
+   * @param writableStackTrace whether or not the stack trace should be 
writable
+   */
+  public HelixException(String message, boolean writableStackTrace) {
+    super(message, null, false, writableStackTrace);
+  }
+
   public HelixException(Throwable cause) {
     super(cause);
   }
diff --git 
a/helix-core/src/main/java/org/apache/helix/messaging/handling/AsyncCallbackService.java
 
b/helix-core/src/main/java/org/apache/helix/messaging/handling/AsyncCallbackService.java
index 4b04770..6b73b1a 100644
--- 
a/helix-core/src/main/java/org/apache/helix/messaging/handling/AsyncCallbackService.java
+++ 
b/helix-core/src/main/java/org/apache/helix/messaging/handling/AsyncCallbackService.java
@@ -69,7 +69,7 @@ public class AsyncCallbackService implements 
MultiTypeMessageHandlerFactory {
               + " does not have correponding callback. Probably timed out 
already. Correlation id: "
               + correlationId;
       _logger.error(errorMsg);
-      throw new HelixException(errorMsg);
+      throw new HelixException(errorMsg, false);
     }
     _logger.info("Verified reply message " + message.getMsgId() + " 
correlation:" + correlationId);
   }

Reply via email to