[Bug] Proxy gRPC HeaderInterceptor fails on unresolved socket addresses
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
[Bug] TopicValidator rejects V2 retry topic names containing `+` separator introduced by KeyBuilder Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100