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

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

Github user itaifrenkel commented on a diff in the pull request:

    https://github.com/apache/storm/pull/489#discussion_r27454533
  
    --- Diff: storm-core/src/jvm/backtype/storm/utils/ShellProcess.java ---
    @@ -186,4 +163,35 @@ public String getProcessInfoString() {
         public String getProcessTerminationInfoString() {
             return String.format(" exitCode:%s, errorString:%s ", 
getExitCode(), getErrorsString());
         }
    +
    +    private Optional<String> getErrorStreamMessage() {
    +        int offset = 0;
    +        if (processErrorStream != null) {
    +            ByteArrayOutputStream out = null;
    +            try {
    +                do {
    +                    int bufferSize = processErrorStream.available();
    +                    if (bufferSize > 0) {
    +                        if (out == null) {
    +                            out = new ByteArrayOutputStream();
    +                        }
    +                        byte[] errorReadingBuffer = new byte[bufferSize];
    +                        final int read = 
processErrorStream.read(errorReadingBuffer, 0, bufferSize);
    +                        out.write(errorReadingBuffer, offset, bufferSize);
    +                        offset += read;
    +                    }
    +                } while (processErrorStream.available() > 0);
    --- End diff --
    
    you can move this check inside so it would be more readable. if (bufferSize 
== 0) { break;}


> ShellBolts that don't respond to heartbeats are not being killed
> ----------------------------------------------------------------
>
>                 Key: STORM-733
>                 URL: https://issues.apache.org/jira/browse/STORM-733
>             Project: Apache Storm
>          Issue Type: Bug
>    Affects Versions: 0.9.3
>            Reporter: Re'em Bensimhon
>            Assignee: Re'em Bensimhon
>            Priority: Critical
>
> In cases where a multilang bolt is stuck (say, an infinite loop), the 
> heartbeats are supposed to detect the issue and kill the supervisor process.
> In 0.9.3 this doesn't happen due to 
> backtype.storm.utils.ShellProcess.getErrorsString() call in ShellBolt.die()
> This call, which in turn executes IOUtils.toString(processErrorStream) will 
> block the thread until process exits. Heartbeat flow should not assume 
> process had exited.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to