YARN-10703. Fix potential null pointer error of gpuNodeResourceUpdateHandler in NodeResourceMonitorImpl. Contributed by Qi Zhu.

This commit is contained in:
Eric Badger 2021-03-18 17:45:09 +00:00
parent ce6bfd5718
commit 181b9ddc51
1 changed files with 4 additions and 2 deletions

View File

@ -173,8 +173,10 @@ public class NodeResourceMonitorImpl extends AbstractService implements
float nodeGpuUtilization = 0F; float nodeGpuUtilization = 0F;
try { try {
if (gpuNodeResourceUpdateHandler != null) {
nodeGpuUtilization = nodeGpuUtilization =
gpuNodeResourceUpdateHandler.getNodeGpuUtilization(); gpuNodeResourceUpdateHandler.getNodeGpuUtilization();
}
} catch (Exception e) { } catch (Exception e) {
LOG.error("Get Node GPU Utilization error: " + e); LOG.error("Get Node GPU Utilization error: " + e);
} }