[ 
https://issues.apache.org/jira/browse/STORM-1574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167311#comment-15167311
 ] 

ASF GitHub Bot commented on STORM-1574:
---------------------------------------

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.


> 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)

Reply via email to