Aias00 commented on code in PR #7777:
URL: https://github.com/apache/shenyu/pull/7777#discussion_r4303313019
##########
shenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/FixedRetryStrategy.java:
##########
@@ -56,15 +61,22 @@ public FixedRetryStrategy(final AbstractHttpClientPlugin<R>
httpClientPlugin) {
* @return Response Mono object after retry processing
*/
public Mono<R> execute(final Mono<R> response, final ServerWebExchange
exchange, final Duration duration, final int retryTimes) {
- Retry retrySpec = initFixedBackoff(exchange, retryTimes);
- Duration totalTimeout = RetryTimeoutUtils.totalTimeout(duration,
retryTimes, Duration.ofSeconds(2));
- return response.retryWhen(retrySpec)
+ Mono<R> retriedResponse;
+ if
(RetryEnum.FAILOVER.getName().equals(exchange.getAttribute(Constants.RETRY_STRATEGY)))
{
+ retriedResponse = new
DefaultRetryStrategy<>(httpClientPlugin).executeFailover(response, exchange,
duration, retryTimes, BACKOFF,
Review Comment:
This branch changes one observable behaviour: with a single-upstream
selector the only candidate is excluded, so the retry budget is unused and the
caller gets 503 `CANNOT_FIND_HEALTHY_UPSTREAM_URL_AFTER_FAILOVER`, where the
old fixed path retried the same URI after 2s. Either pin it with a test (so it
is clearly intentional + a release-note line) or fall back to retrying the
original URI when no standby exists. Nothing currently covers the
empty-candidate case (details in the review body).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]