Repository navigation
fix(httpclient): fail over on upstream server errors - #7097
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new Reactor Netty failover path lacks regression coverage.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds failover handling for upstream HTTP 5xx responses in both HTTP client implementations.
Changes:
- Adds a shared failover status predicate and exception.
- Converts 5xx responses into retryable errors under
FAILOVER. - Adds WebClient regression coverage.
File summaries
| File | Description |
|---|---|
AbstractHttpClientPlugin.java |
Adds shared failover status detection. |
WebClientPlugin.java |
Maps failover 5xx responses to errors. |
NettyHttpClientPlugin.java |
Drains 5xx responses and emits retryable errors. |
ShenyuUpstreamStatusException.java |
Defines the upstream status exception. |
WebClientPluginTest.java |
Tests WebClient 5xx failover behavior. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Aias00
left a comment
There was a problem hiding this comment.
Approved as PMC (Aias00). Small, well-scoped fix with regression tests; green CI, mergeable. Reviewed the diff.
Aias00
left a comment
There was a problem hiding this comment.
Re-reviewed: surfacing upstream 5xx as retryable (ShenyuUpstreamStatusException) so failover triggers correctly is a meaningful resilience fix, applied consistently across the HTTP client implementations and covered by tests. Approving.
Make HTTP client implementations surface upstream 5xx responses as retryable errors when the FAILOVER strategy is active. This lets the existing retry pipeline select another upstream server while preserving current response handling for other retry strategies.
Test:
mvn -pl shenyu-plugin/shenyu-plugin-httpclient -am -DskipTests=false -Dcheckstyle.skip=false -Dtest=WebClientPluginTest,NettyHttpClientPluginTest,RetryStrategyTest -DfailIfNoTests=false testFixes #6734