Sigma-Ma opened a new pull request, #8483:
URL: https://github.com/apache/hbase/pull/8483

   ### 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?
   
   ```bash
   mvn -pl hbase-server -am \
     -Dtest=TestBootstrapNodeManager \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -DskipITs \
     test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to