You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2019/03/01 14:53:00 UTC

[jira] [Updated] (YARN-9076) ContainerShellWebSocket Render Process Output

     [ https://issues.apache.org/jira/browse/YARN-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

BELUGA BEHR updated YARN-9076:
------------------------------
    Attachment: YARN-9076.2.patch

> ContainerShellWebSocket Render Process Output
> ---------------------------------------------
>
>                 Key: YARN-9076
>                 URL: https://issues.apache.org/jira/browse/YARN-9076
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: webapp
>    Affects Versions: 3.3.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: YARN-9076.1.patch, YARN-9076.2.patch
>
>
> {code:java|title=ContainerShellWebSocket.java}
>         // Render process output
>         int no = pair.in.available();
>         pair.in.read(buffer, 0, Math.min(no, buffer.length));
>         String formatted = new String(buffer, Charset.forName("UTF-8"))
>             .replaceAll("\n", "\r\n");
>         session.getRemote().sendString(formatted);
>       }
> {code}
> This code strikes me as a bit odd.  First of it, it is using {{available{}}} which is known as a being unreliable and inaccurate (i.e., for sockets) .  Second, it will only read a max of 4000 characters and that's it.  Anything else is truncated.
> Change this code to read the entire data stream.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org