Arvind Kandpal created HBASE-30541:
--------------------------------------

             Summary: [hbtop] NPE when the first getClusterMetrics() call fails
                 Key: HBASE-30541
                 URL: https://issues.apache.org/jira/browse/HBASE-30541
             Project: HBase
          Issue Type: Bug
          Components: hbtop
            Reporter: Arvind Kandpal
            Assignee: Arvind Kandpal


When the first call to Admin#getClusterMetrics() fails, 
TopScreenModel#refreshMetricsData logs the error and returns, so records and 
summary stay null. TopScreenPresenter#refresh then calls getRecords().size() 
and throws a NullPointerException. The first refresh runs outside the try/catch 
in Screen#run, so hbtop exits with:

{code}
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because 
the return value of 
"org.apache.hadoop.hbase.hbtop.screen.top.TopScreenModel.getRecords()" is null 
at 
org.apache.hadoop.hbase.hbtop.screen.top.TopScreenPresenter.refresh(TopScreenPresenter.java:108)
{code}

This happens when the connection succeeds but the cluster metrics call fails, 
for example while the master is initializing or on an RPC timeout.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to