GitHub user dashengju opened a pull request:

    https://github.com/apache/incubator-storm/pull/218

    [STORM-442] multilang ShellBolt/ShellSpout die() can be hang when Exception 
happened

    In ShellBolt, the _readerThread read command from python/shell process, and 
handle like this:
     try
     { 
        ShellMsg shellMsg = _process.readShellMsg(); 
        ... 
     } catch (InterruptedException e) {
     } catch (Throwable t) { 
        die(t); 
     }
    
    And in the die function, getProcessTerminationInfoString will read 
getErrorsString() from processErrorStream.
    
    private void die(Throwable exception) { 
         String processInfo = _process.getProcessInfoString() + 
_process.getProcessTerminationInfoString(); 
         _exception = new RuntimeException(processInfo, exception); 
    }
    
    so when ShellBolt got exception(for example, readShellMsg() throw NPE ) , 
but it is not an error from sub process, then getProcessTerminationInfoString 
will be hang because processErrorStream have no data to read.
    
    On the other hand, as Kang Xiao says ShellBolt should fail fast on 
exception ( https://github.com/apache/incubator-storm/pull/46 ) , I think it is 
not a good idea to read error info from stream.
    
    Because Kang Xiao 's PR is based old version, so I will move his code to 
this PR, and modify the same place in ShellSpout.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dashengju/incubator-storm Multilang_die_hang

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-storm/pull/218.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #218
    
----
commit b35883daa1dbbdec6d10dd34630c2f8ea27d6833
Author: JuDasheng <[email protected]>
Date:   2014-08-07T09:08:11Z

    solve multilang ShellBolt/ShellSpout die() can be hang when Exception 
happened

----


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

Reply via email to