Skip to content

HBASE-30101 Move login() before RpcServer construction#8122

Open
junegunn wants to merge 1 commit intoapache:masterfrom
junegunn:HBASE-30101-early-login
Open

HBASE-30101 Move login() before RpcServer construction#8122
junegunn wants to merge 1 commit intoapache:masterfrom
junegunn:HBASE-30101-early-login

Conversation

@junegunn
Copy link
Copy Markdown
Member

The RpcServer constructor calls userProvider.getCurrentUserName()
(HBASE-28321) which triggers UserGroupInformation.getCurrentUser().
If the server has not logged in yet, UGI bootstraps from the ticket
cache and spawns a TGT renewer for whichever principal happens to be
there, regardless of the principal the server is configured to use.

Resolve the hostname up front via DNS.getHostname(...) and run the
ZK client and server logins before createRpcServices(), so that UGI
is already bound to the keytab principal by the time the RpcServer
constructor runs.

HRegionServer.getUseThisHostnameInstead() previously fell back to
rpcServices.getSocketAddress().getHostName() when the reverse-DNS
disable flag was set; that branch now uses DNS.getHostname directly
so it no longer depends on rpcServices being constructed.
Copy link
Copy Markdown
Contributor

@Apache9 Apache9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the correct way to fix the problem, we should setup the resources before starting rpc server.

@junegunn junegunn marked this pull request as ready for review April 24, 2026 13:37
@junegunn
Copy link
Copy Markdown
Member Author

I agree. #8110 doesn't fix the problem on 2.6+ anyway. I still think it's the right thing to do, but once this is merged, that one becomes optional.

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.

2 participants