Skip to content

HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup#8483

Open
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30099-bootstrap-nodes-startup
Open

HBASE-30099 Avoid NPE when GetBootstrapNodes RPC arrives during startup#8483
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30099-bootstrap-nodes-startup

Conversation

@Sigma-Ma

@Sigma-Ma Sigma-Ma commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Make HRegionServer#getBootstrapNodes return an empty iterator when bootstrapNodeManager has not been initialized yet.

Declare bootstrapNodeManager as volatile to ensure safe publication between the RegionServer startup thread and RPC handler threads.

Add a regression test covering calls to getBootstrapNodes before bootstrapNodeManager initialization.

Why are the changes needed?

The RPC server can start accepting connections before preRegistrationInitialization() assigns bootstrapNodeManager.

If a GetBootstrapNodes RPC arrives during this startup window, HRegionServer#getBootstrapNodes dereferences a null bootstrapNodeManager and throws a NullPointerException.

Returning an empty iterator during this window avoids the startup race and allows callers to continue bootstrap-node discovery normally.

How was this patch tested?

mvn -pl hbase-server -am \
  -Dtest=TestBootstrapNodeManager \
  -Dsurefire.failIfNoSpecifiedTests=false \
  -DskipITs \
  test

@Sigma-Ma

Copy link
Copy Markdown
Contributor Author

Hi maintainers, the three GitHub Actions workflows for this fork PR are awaiting approval. This PR does not modify any workflow files.

Could someone with write access approve them when convenient? Thanks.

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