Jose Luis López created YARN-12026:
--------------------------------------
Summary: Timeline server picks its JSON writer anew at each start:
JettisonFeature and YarnJacksonJaxbJsonProvider are both registered
Key: YARN-12026
URL: https://issues.apache.org/jira/browse/YARN-12026
Project: Hadoop YARN
Issue Type: Bug
Components: timelineserver
Affects Versions: 3.6.0
Reporter: Jose Luis López
*Problem*: the timeline server (ApplicationHistoryServer) does not answer in
one JSON format. Each time it starts, it picks one of two JSON writers, and the
same request then returns a differently shaped body:
* Jackson: lists as JSON arrays, an empty list as {{[]}}, fields in declared
order;
* Jettison: a one-element list collapsed to an object, an empty list as {{""}},
and JAXB field names such as {{eventInfoJAXB}}.
Seen on the timeline v1 put response, entity events and domains, and the
application history responses (apps, app attempts). Restarting one build six
times answered once with Jackson and five times with Jettison. A client that
parses these responses can work after one restart and fail after the next.
*Cause*: {{ApplicationHistoryServer#configure}} registers both writers:
{code:java}
config.register(new
JettisonFeature()).register(YarnJacksonJaxbJsonProvider.class);
{code}
Both can write these JAXB beans as {{application/json}}, nothing gives one
precedence, and the one Jersey picks varies from one start to the next.
*Fix*: register a single JSON provider for these resources, or give one of them
an explicit priority, so that the format is fixed. Which one should be decided
against what earlier releases returned.
{{TimelineReaderServer}} and {{NodeTimelineCollectorManager}} (timeline service
v2) register the same pair; I have not checked whether they show the same
behaviour.
*How it was found*: the Jetty 12 phase A harness (HADOOP-19912) compares the
REST responses of two builds; these responses changed shape between runs of the
same build, on either side.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]