harshkha3417 opened a new pull request, #7835:
URL: https://github.com/apache/shenyu/pull/7835

   Resolves #7824.
   
   For HTTP routes where retry is disabled (`retryTimes <= 0`), every request 
previously went through the full retry machinery:
   1. Allocating a `RetryStrategy` instance (`new 
DefaultRetryStrategy<>(this)`, `new FixedRetryStrategy<>(this)`, or `new 
ExponentialRetryBackoffStrategy<>(this)`).
   2. Constructing `RetryBackoffSpec` / `Retry.backoff` / `Retry.fixedDelay` 
with duration, jitter, filter predicates, and exhaustion throwers.
   3. Calculating total timeout budget and attaching a redundant 
`.timeout(totalTimeout)` operator (since `response` is already bounded by 
`.timeout(duration)`).
   4. Subscribing through `.retryWhen(...)`.
   ### Brief changelog
   - **Lightweight zero-retry execution**: Added `executeWithoutRetry` in 
`AbstractHttpClientPlugin` when `retryTimes <= 0`, bypassing `RetryStrategy` 
instantiation, backoff spec creation, redundant total timeout operators, and 
`retryWhen(...)`.
   - **Exact error mapping preservation**:
     - For `DEFAULT_BACKOFF` with `current` retry strategy, transient 
exceptions (`TimeoutException`, `ConnectTimeoutException`, 
`ReadTimeoutException`, and `IllegalStateException` except 
`DataBufferLimitException`) are mapped to `408 REQUEST_TIMEOUT` ("Request 
timeout, the maximum number of retry times has been exceeded"), matching 
`DefaultRetryStrategy`.
     - Non-default strategies (`failover`, `fixed`, `exponential`) return the 
response directly, allowing existing plugin error mappings (`504 
GATEWAY_TIMEOUT`, `503 SERVICE_UNAVAILABLE`, `413 PAYLOAD_TOO_LARGE`) to handle 
them identically to their exhausted zero-retry behavior.
   - **Unchanged positive retry path**: Routes with `retryTimes > 0` continue 
executing through their configured `RetryStrategy`.
   - **Tests**: Added `AbstractHttpClientPluginTest` verifying transient error 
predicate filtering, zero-retry status mappings (408, 413, 503, 504), error 
propagation, and positive retry execution.


-- 
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]

Reply via email to