[
https://issues.apache.org/jira/browse/YARN-5725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15615923#comment-15615923
]
Daniel Templeton commented on YARN-5725:
----------------------------------------
Thanks, [[email protected]]. One quick comment on the patch. I'd
rather make this: {code} if (container != null) {
if (ipAndHost != null && ipAndHost[0] != null
&& ipAndHost[1] != null) {
container.setIpAndHost(ipAndHost);
LOG.info(containerId + "'s ip = " + ipAndHost[0]
+ ", and hostname = " + ipAndHost[1]);
} else {
LOG.info("Can not get both ip and hostname: " + Arrays
.toString(ipAndHost));
}
} else {
LOG.info("Can not get both ip and hostname: " + Arrays
.toString(ipAndHost));
LOG.warn(containerId + " is missing. Not setting ip and " +
"hostname");
}{code} be more like this: {code} if ((container != null) &&
(ipAndHost != null) &&
(ipAndHost[0] != null) && (ipAndHost[1] != null)) {
container.setIpAndHost(ipAndHost);
LOG.info(containerId + "'s ip = " + ipAndHost[0]
+ ", and hostname = " + ipAndHost[1]);
} else if (container != null) {
LOG.info("Can not get both ip and hostname: " + Arrays
.toString(ipAndHost));
} else {
LOG.info("Can not get both ip and hostname: " + Arrays
.toString(ipAndHost));
LOG.warn(containerId + " is missing. Not setting ip and " +
"hostname");
}{code}
Also note that in that code the continued lines are indented wrong. I'm
surprised checkstyle didn't complain.
In the test code, your mock of the {{Container}} should actually be a mock of
{{ContainerImpl}}. As is it's causing class cast exceptions:
{noformat}
java.lang.ClassCastException:
org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container$$EnhancerByMockitoWithCGLIB$$3094eeba
cannot be cast to
org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl
at
org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl$MonitoringThread.reportResourceUsage(ContainersMonitorImpl.java:701)
at
org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl$MonitoringThread.run(ContainersMonitorImpl.java:483)
{noformat}
And you should use the diamond operator when creating your
{{ConcurrentSkipListMap}}.
> Test uncaught exception in
> TestContainersMonitorResourceChange.testContainersResourceChange when setting
> IP and host
> --------------------------------------------------------------------------------------------------------------------
>
> Key: YARN-5725
> URL: https://issues.apache.org/jira/browse/YARN-5725
> Project: Hadoop YARN
> Issue Type: Bug
> Components: nodemanager
> Reporter: Miklos Szegedi
> Assignee: Miklos Szegedi
> Priority: Minor
> Labels: oct16-easy
> Attachments: YARN-5725.000.patch, YARN-5725.001.patch,
> YARN-5725.002.patch, YARN-5725.003.patch, YARN-5725.004.patch
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> The issue is a warning but it prevents container monitor to continue
> 2016-10-12 14:38:23,280 WARN [Container Monitor]
> monitor.ContainersMonitorImpl (ContainersMonitorImpl.java:run(594)) -
> Uncaught exception in ContainersMonitorImpl while monitoring resource of
> container_123456_0001_01_000001
> java.lang.NullPointerException
> at
> org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl$MonitoringThread.run(ContainersMonitorImpl.java:455)
> 2016-10-12 14:38:23,281 WARN [Container Monitor]
> monitor.ContainersMonitorImpl (ContainersMonitorImpl.java:run(613)) -
> org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl
> is interrupted. Exiting.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]