[Bug] SimpleChannel should tolerate malformed socket address ports
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java
- Domain
- backend, networking
Research direction
Start in the proxy module by locating SimpleChannel and its parseSocketAddress method. Read how remoteAddress() and localAddress() use the parser, then run or add unit tests covering valid addresses, blank or missing-port values, and non-numeric ports. Done means malformed socket addresses return null without throwing while valid addresses still parse correctly.
Written by the indexing model from the issue text.
Description
Bug description
SimpleChannel.parseSocketAddress returns null for empty addresses or strings that do not split into host:port, but it directly calls Integer.parseInt(segments[1]) when the input has two segments.
For malformed values such as 127.0.0.1:not-a-port, calling remoteAddress() or localAddress() on SimpleChannel throws NumberFormatException instead of treating the address as invalid.
SimpleChannel is used by the proxy to adapt request contexts into lightweight Netty channels for local/remoting processing. A malformed address string should not make address access throw unexpectedly.
Expected behavior
SimpleChannel should tolerate malformed port values and return null for invalid socket address strings, consistent with how it already handles blank and non-host:port values.
Affected area
proxy module, internal SimpleChannel address parsing.
Suggested fix
- Catch invalid port parsing in
parseSocketAddress. - Return
nullfor malformed port values. - Add unit tests for valid addresses, blank/missing-port values, and non-numeric port values.
- 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