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;}


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to