-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling throwable during Helix message processing #2696
Handling throwable during Helix message processing #2696
Conversation
e045d61
to
87b6192
Compare
helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTaskExecutor.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTaskExecutor.java
Outdated
Show resolved
Hide resolved
87b6192
to
00f4569
Compare
This PR is ready to be merged |
Thanks @csudharsanan for composing the PR! Normally we require a "approval" before merge. We will take another round of review :D |
helix-core/src/test/java/org/apache/helix/messaging/handling/TestHelixTaskExecutor2.java
Outdated
Show resolved
Hide resolved
Ahh my bad. |
00f4569
to
9a596c4
Compare
9a596c4
to
2c1a38b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw what is CM in TestCM ??
helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTaskExecutor.java
Outdated
Show resolved
Hide resolved
helix-core/src/main/java/org/apache/helix/util/StatusUpdateUtil.java
Outdated
Show resolved
Hide resolved
@@ -488,11 +490,11 @@ public boolean scheduleTask(MessageTask task) { | |||
"Message handling task already sheduled for " + taskId, manager); | |||
} | |||
} | |||
} catch (Exception e) { | |||
} catch (Throwable e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Helix, we use general Exception instead of Throwable. Even Throwable, you need to replace variable name to t.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated variable name to t. Since OOME encountered in this GCN is an error, we had to update this to throwable instead of Exception.
OOME has following lineage:
java.lang.Throwable
-->java.lang.Error
-->java.lang.VirtualMachineError
--->java.lang.OutOfMemoryError
CM stands for ClusterManager, there were two TestHelixTaskExecutors within the same module and had to rename the new Test class to this. |
2c1a38b
to
ded7aa5
Compare
_statusUpdateUtil | ||
.logError(message, HelixTaskExecutor.class, e, "Error while executing task " + e, | ||
.logError(message, HelixTaskExecutor.class, "Error while executing task " + t, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider not integrate the Throwable in message. If we do it this way, it only print out a short description of this throwable.
We may want to print the stack trace and other information. Please consider something like.
public void logError(Message message, Class classInfo, Exception e, String additionalInfo,
HelixManager manager)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can close this one, as created #2730 for addressing the comments
Issues
fixes Failure path not executed on encountering throwable error during message processing. #2695
Description
Tests
TestHelixTaskExecutor:
testThrowableHandlingOnMessageProcess
(If CI test fails due to known issue, please specify the issue and test PR locally. Then copy & paste the result of "mvn test" to here.)
Changes that Break Backward Compatibility (Optional)
(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)
Documentation (Optional)
(Link the GitHub wiki you added)
Commits
Code Quality
(helix-style-intellij.xml if IntelliJ IDE is used)