Skip to content

[ISSUE #10834] fix(remoting): parse bracketed IPv6 broker addresses - #10844

Open
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-6
Open

[ISSUE #10834] fix(remoting): parse bracketed IPv6 broker addresses#10844
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-6

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Aug 8, 2026

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

Parse bracketed IPv6 broker addresses without truncating the host while preserving IPv4 and host-only behavior.

How Did You Test This Change?

  • mise x java@temurin-17 -- mvn -pl remoting -am -Dtest=RemotingHelperTest -Dsurefire.failIfNoSpecifiedTests=false test

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.32%. Comparing base (fd0c959) to head (9d97163).

Files with missing lines Patch % Lines
...pache/rocketmq/remoting/common/RemotingHelper.java 70.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10844      +/-   ##
=============================================
- Coverage      48.37%   48.32%   -0.05%     
+ Complexity     13555    13541      -14     
=============================================
  Files           1380     1380              
  Lines         101165   101171       +6     
  Branches       13127    13130       +3     
=============================================
- Hits           48940    48893      -47     
- Misses         46250    46289      +39     
- Partials        5975     5989      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Important fix for IPv6 support — the original split(":") approach completely breaks on bracketed IPv6 addresses like [2001:db8::1]:10911. The new implementation correctly handles:

  • Bracketed IPv6: [addr]:port → extracts host between brackets
  • IPv4: host:port → extracts host before colon
  • No-port addresses → returns full address

Good test coverage including edge cases.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RemotingHelper parses bracketed IPv6 broker addresses incorrectly

3 participants