Before Creating the Bug Report
Describe the Bug
HeaderInterceptor#parseSocketAddress assumes that every InetSocketAddress has a resolved InetAddress:
inetSocketAddress.getAddress().getHostAddress()
For unresolved socket addresses, InetSocketAddress#getAddress() returns null. In that case the gRPC header interceptor throws a NullPointerException while parsing the remote or local address, interrupting request handling before the call reaches the next handler.
Expected Behavior
The interceptor should tolerate unresolved addresses and still preserve useful diagnostics. It can use InetSocketAddress#getHostString() as a fallback and keep formatting the address as host:port.
Scope
RocketMQ Studio Track 2 / Proxy gRPC runtime diagnostics and admin-facing connection metadata. This is a small defensive fix in the Proxy gRPC interceptor path.
Proposed Fix
Update parseSocketAddress to use the resolved host address when available, otherwise fall back to getHostString(). Add a regression test covering unresolved remote/local socket addresses.
Before Creating the Bug Report
Describe the Bug
HeaderInterceptor#parseSocketAddressassumes that everyInetSocketAddresshas a resolvedInetAddress:For unresolved socket addresses,
InetSocketAddress#getAddress()returnsnull. In that case the gRPC header interceptor throws aNullPointerExceptionwhile parsing the remote or local address, interrupting request handling before the call reaches the next handler.Expected Behavior
The interceptor should tolerate unresolved addresses and still preserve useful diagnostics. It can use
InetSocketAddress#getHostString()as a fallback and keep formatting the address ashost:port.Scope
RocketMQ Studio Track 2 / Proxy gRPC runtime diagnostics and admin-facing connection metadata. This is a small defensive fix in the Proxy gRPC interceptor path.
Proposed Fix
Update
parseSocketAddressto use the resolved host address when available, otherwise fall back togetHostString(). Add a regression test covering unresolved remote/local socket addresses.