Skip to content

[Bug] Proxy gRPC HeaderInterceptor fails on unresolved socket addresses #10799

Description

@Aias00

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Issues.
  • I have searched the existing issues and believe this is not a duplicate.
  • I have confirmed that this bug belongs to the current repository.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions