[ISSUE #10799] Tolerate unresolved gRPC peer addresses - #10800
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds resilience in HeaderInterceptor when gRPC provides unresolved InetSocketAddress values, preventing NPEs and preserving host:port formatting, with a regression test to cover this case.
Changes:
- Update socket address parsing to gracefully handle unresolved
InetSocketAddressviagetHostString(). - Add regression test verifying remote/local unresolved peer addresses are written into headers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| proxy/src/main/java/org/apache/rocketmq/proxy/grpc/interceptor/HeaderInterceptor.java | Avoids NPE by using getHostString() when InetSocketAddress#getAddress() is null; keeps host:port output. |
| proxy/src/test/java/org/apache/rocketmq/proxy/grpc/interceptor/HeaderInterceptorTest.java | Adds coverage for unresolved remote/local transport addresses being propagated into metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public MethodDescriptor<String, String> getMethodDescriptor() { | ||
| return null; | ||
| } |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10800 +/- ##
=============================================
- Coverage 48.60% 48.51% -0.10%
+ Complexity 13690 13656 -34
=============================================
Files 1381 1381
Lines 101464 101467 +3
Branches 13187 13189 +2
=============================================
- Hits 49318 49227 -91
- Misses 46158 46215 +57
- Partials 5988 6025 +37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Adds defensive handling for unresolved gRPC peer addresses, preventing NPE/IAE when peer address resolution fails. Good defensive coding with proper fallback behavior.
LGTM.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM — defensive improvement with proper error handling and test coverage.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Defensive fix with proper validation and test coverage. LGTM.
Automated review by github-manager-bot
|
Rebased onto current |
3de7506 to
036e7c6
Compare
Summary
Fixes #10799
Tests