[Bug] Proxy gRPC HeaderInterceptor fails on unresolved socket addresses

Open Beginner friendly
#10,799 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
grpc, java
Domain
api, backend

Research direction

Start by locating HeaderInterceptor#parseSocketAddress and read how the Proxy gRPC interceptor parses remote and local InetSocketAddress values. Add a regression test for unresolved addresses, then run the relevant interceptor tests. Done means request handling no longer throws a NullPointerException and diagnostics retain host:port formatting.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 12h
Merged PRs (30d)
25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/rocketmq

All issues in apache/rocketmq

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.