You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/11/03 08:54:33 UTC
[jira] [Commented] (STORM-442) multilang ShellBolt/ShellSpout die()
can be hang when Exception happened
[ https://issues.apache.org/jira/browse/STORM-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14194339#comment-14194339 ]
ASF GitHub Bot commented on STORM-442:
--------------------------------------
Github user dashengju commented on the pull request:
https://github.com/apache/storm/pull/305#issuecomment-61447792
@HeartSaVioR
yes, there is a chance to occur that subprocess writes stderr for some reason but parent process runs well without Exception. When this happens, parent process will check, and log then to log system.
Below is the ShellBolt and PythonBolt communication flow. As you can see, when the ShellBolt send a tuple to Python, it will read from stderr(call logErrorStream()) to see anything to log, and log info them.

Below is the ShellSpout and PythonSpout communication flow. When the ShellSpout ask for a new tuple, it will read from stderr(call logErrorStream()) to see anything to log, and log info them.

> multilang ShellBolt/ShellSpout die() can be hang when Exception happened
> ------------------------------------------------------------------------
>
> Key: STORM-442
> URL: https://issues.apache.org/jira/browse/STORM-442
> Project: Apache Storm
> Issue Type: Bug
> Affects Versions: 0.9.3
> Reporter: DashengJu
>
> 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 [~xiaokang] 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 [~xiaokang] 's PR is based old version, so I will move his code to this PR, and modify some other place in ShellSpout.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)