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

Jonathan Eagles commented on YARN-9563:
---------------------------------------

Thanks for the patch, [~ahussein]. This will be good for any client parsing 
json results as NaN as INF can be tricky to encode and decode correctly with 
mismatched json generators and parsers (especially with validation turned on).

Couple of things. 1) Like [~giovanni.fumarola] mentioned let's move the logic 
of the code out of the Protobuf implementation as that is mainly meant for POD 
(plain old data). However, I can see the need for that logic as a sufficiently 
large cluster when divided by a small enough number will cause float to go to 
INF. 2) Permanent fix might be to divide and then check for NaN/INF. 3) 
Likewise, some comments are unnecessary and can be cleaned up.

Again, thanks for reaching out.

> Resource report REST API could return NaN or Inf
> ------------------------------------------------
>
>                 Key: YARN-9563
>                 URL: https://issues.apache.org/jira/browse/YARN-9563
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Ahmed Hussein
>            Assignee: Ahmed Hussein
>            Priority: Minor
>         Attachments: YARN-9563.001.patch
>
>
> The Resource Manager's Cluster Applications and Cluster Application REST APIs 
> are sometimes returning invalid JSON. This was addressed in YARN-6082.
> However, the fix only fixes the calculation in one site and does not 
> guarantee to avoid the problem.Likewise, generating NaN/Inf can break the web 
> GUI if the columns cannot render non-numeric values.
> The suggested fix is to check for NaN/Inf in the protob. The protob replaces 
> NaN/Inf by 0.0f.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to