Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-1479

Invalid NaN values in Hadoop REST API JSON response

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.23.6, 2.0.4-alpha
    • Fix Version/s: 2.5.0
    • Component/s: None
    • Labels:
      None

      Description

      I've been occasionally coming across instances where Hadoop's Cluster Applications REST API (http://hadoop.apache.org/docs/r0.23.6/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Applications_API) has returned JSON that PHP's json_decode function failed to parse. I've tracked the syntax error down to the presence of the unquoted word NaN appearing as a value in the JSON. For example:

      "progress":NaN,

      NaN is not part of the JSON spec, so its presence renders the whole JSON string invalid. Hadoop needs to return something other than NaN in this case – perhaps an empty string or the quoted string "NaN".

        Attachments

        1. Yarn-1479.patch
          6 kB
          Chen He
        2. Yarn-1479v2.patch
          10 kB
          Chen He

          Activity

            People

            • Assignee:
              airbots Chen He
              Reporter:
              kthrapp Kendall Thrapp
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: