Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/1149#discussion_r54110183
--- Diff:
storm-core/src/jvm/org/apache/storm/utils/WorkerBackpressureThread.java ---
@@ -43,17 +48,33 @@ static public void notifyBackpressureChecker(Object
trigger) {
}
}
+ public void terminate() {
+ running = false;
+ }
+
public void run() {
- try {
- while (true) {
+ while (running) {
+ try {
synchronized(trigger) {
trigger.wait(100);
}
callback.onEvent(workerData); // check all executors and
update zk backpressure throttle for the worker if needed
+ } catch (InterruptedException interEx) {
+ LOG.info("WorkerBackpressureThread gets interrupted!
Ignoring Exception: ", interEx);
}
- } catch (Exception e) {
- throw new RuntimeException(e);
}
}
}
+class BackpressureUncaughtExceptionHandler implements
Thread.UncaughtExceptionHandler {
+ private static final Logger LOG =
LoggerFactory.getLogger(BackpressureUncaughtExceptionHandler.class);
+ @Override
+ public void uncaughtException(Thread t, Throwable e) {
+ try {
+ Utils.handleUncaughtException(e);
--- End diff --
This ignores all RuntimeExceptions. This is fine for what it was
originally written for, which was around thread pools. But in this case any
RuntimeException is going to still cause the backpressure thread to exit.
@kishorvpatil would you be OK if we renamed handeUncaughtException to be
more descriptive, because it is deceptive right now, and I think will cause bug
while we translate code to java. Can we call it eatRuntimeExitOnOOM.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---