Github user abhishekagarwal87 commented on a diff in the pull request: https://github.com/apache/storm/pull/1149#discussion_r54049182 --- 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); + } catch (Error error) { + LOG.info("Received error in WorkerBackpressureThread.. terminating the worker..."); --- End diff -- This should be LOG.error and error can be passed as second argument.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---