Skip to content

HBASE-30541 [hbtop] NPE when the first getClusterMetrics() call fails (branch-2) - #8886

Open
arvindKandpal-ksolves wants to merge 1 commit into
apache:branch-2from
arvindKandpal-ksolves:HBASE-30541-branch-2
Open

arvindKandpal-ksolves wants to merge 1 commit into
apache:branch-2from
arvindKandpal-ksolves:HBASE-30541-branch-2

Conversation

@arvindKandpal-ksolves

Copy link
Copy Markdown
Contributor

Backport to branch-2.

Problem

When the first Admin#getClusterMetrics() call fails, TopScreenModel keeps records and summary as null, and TopScreenPresenter#refresh throws a NullPointerException on getRecords().size(). hbtop exits with this NPE.

Changes

  • TopScreenModel: initialize records to an empty list.
  • TopScreenView: skip the summary while no metrics have been fetched yet.
  • TestTopScreenModel: add a test where the first getClusterMetrics() call fails.

With this change, hbtop logs the error and retries on the next refresh.

Testing

  • Clean cherry-pick from master.
  • All hbtop tests pass on branch-2, including the new test; spotless passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant