Silence Stacktrace from Stale Reply Messages (#1460)
This commits adds a less verbose (no stacktrace) HelixException
and raises it for stale reply message cases.
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 @@
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 @@
+ " 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);
}