[ https://issues.apache.org/jira/browse/STORM-1574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15166730#comment-15166730 ]
ASF GitHub Bot commented on STORM-1574: --------------------------------------- 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. > Better exception handling in backpressure thread, and remove backpressure dir > during topology kill. > --------------------------------------------------------------------------------------------------- > > Key: STORM-1574 > URL: https://issues.apache.org/jira/browse/STORM-1574 > Project: Apache Storm > Issue Type: Improvement > Components: storm-core > Affects Versions: 1.0.0, 2.0.0 > Reporter: Zhuo Liu > Assignee: Zhuo Liu > Fix For: 1.0.0, 2.0.0 > > > The current exception handling in WorkerBackpressureThread can cause the > thread to die before we want, causing potential backpressure flag > synchronizing problem. > Also, we need to cleanup the topology backpressure directory during killing. -- This message was sent by Atlassian JIRA (v6.3.4#6332)