[
https://issues.apache.org/jira/browse/YARN-7908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16357167#comment-16357167
]
Jason Lowe commented on YARN-7908:
----------------------------------
The line that corresponds with that NPE is:
{code:java}
Assert.assertEquals(container.getAllocatedResource().getMemorySize(),
// KeyValueBasedTimelineStore could cast long to integer, need make sure
// variables for compare have same type.
((Integer) entity.getOtherInfo().get(
ContainerMetricsConstants.ALLOCATED_MEMORY_ENTITY_INFO))
.longValue());
{code}
Looks like the result of the {{get}} was null and the code blindly tried to
dereference it.
I think there may be issues with the state store persisting across multiple
tests. Many tests use the same container ID, and I think there could be a race
where the test polls for a container finished event not realizing this event is
a stale one from a previous test.
> TestSystemMetricsPublisher#testPublishContainerMetrics can fail with an NPE
> ---------------------------------------------------------------------------
>
> Key: YARN-7908
> URL: https://issues.apache.org/jira/browse/YARN-7908
> Project: Hadoop YARN
> Issue Type: Bug
> Components: test
> Affects Versions: 2.8.3
> Reporter: Jason Lowe
> Priority: Major
>
> testPublishContainerMetrics can fail with a NullPointerException:
> {noformat}
> Running
> org.apache.hadoop.yarn.server.resourcemanager.metrics.TestSystemMetricsPublisher
> Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.42 sec <<<
> FAILURE! - in
> org.apache.hadoop.yarn.server.resourcemanager.metrics.TestSystemMetricsPublisher
> testPublishContainerMetrics(org.apache.hadoop.yarn.server.resourcemanager.metrics.TestSystemMetricsPublisher)
> Time elapsed: 0.031 sec <<< ERROR!
> java.lang.NullPointerException: null
> at
> org.apache.hadoop.yarn.server.resourcemanager.metrics.TestSystemMetricsPublisher.testPublishContainerMetrics(TestSystemMetricsPublisher.java:454)
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]