MVC Spring Retry based retry filter never retries on exceptions
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java, spring, spring-boot
Hướng nghiên cứu
Start with GatewayRetryFilterFunctions.java in spring-cloud-gateway-server-webmvc and trace how SimpleRetryPolicy and HttpRetryPolicy combine; the issue links the relevant lines. Compare the Spring Framework based MVC and WebFlux filters, then add tests showing configured exception retries and status based retries stop at the configured limit. The issue author says a fix with tests is ready and plans to open a PR, so check for that work before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Spring Cloud Gateway Server WebMVC 5.0.x (also on main), using the Spring Retry based filter (GatewayRetryFilterFunctions, the default when Spring Retry is on the classpath).
Exception based retries never happen. GatewayRetryFilterFunctions.retry(RetryConfig) combines a SimpleRetryPolicy (built from the configured exceptions) with HttpRetryPolicy in a CompositeRetryPolicy:
The composite is pessimistic (every policy must agree), and HttpRetryPolicy extends NeverRetryPolicy: for anything other than a RetryException it returns super.canRetry(context), which is false once registerThrowable has been called. So the configured exceptions are effectively ignored and the first exception is rethrown without any retry. The Framework based MVC filter and the WebFlux filter do retry on exceptions.
Related to #3862, which reports the same symptom (no retry when the proxied call fails with an exception) for the MVC gateway.
Sample
Reproduced with Spring Boot 4.0.9 / Spring Cloud 2025.1.4 and spring-retry on the classpath: a route with retry(c -> c.setRetries(3).addExceptions(ResourceAccessException.class)) in front of a backend that closes the connection without a response. The filter raised ResourceAccessException after a single attempt (Retry: count=0 → Retry failed last attempt: count=1). Expected: the configured number of retries.
Proposed fix: HttpRetryPolicy.canRetry should only decide for RetryException (status based retries) and return true otherwise, leaving classification to the SimpleRetryPolicy, which already knows the configured exceptions. Making the composite optimistic instead would not work, since HttpRetryPolicy has no attempt counter and status based retries would never stop. I have a fix with tests ready and will open a PR.
- Ngôn ngữ chính
- Java
- Star
- 4.9k
- Fork
- 3.5k
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spring-cloud/spring-cloud-gateway
-
waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
spring-cloud/spring-cloud-gateway#4395 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RequestRateLimiterGatewayFilterFactory commits 429 response instead of throwingCó thể đã có người làm @seonwooj0810 đã nhận 175 ngày trước. Đang mởwaiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
spring-cloud/spring-cloud-gateway#4175 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add @Order annotation to gatewayRestClientCustomizer BeanCó thể đã có người làm @CheHyeonYeong đã nhận 247 ngày trước. Đang mởenhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
spring-cloud/spring-cloud-gateway#3626 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Ambiguity in section 19 of the documentation - Spring Cloud Gateway - Custom Route PredicateCó thể đã có người làm @won-seoop đã nhận 173 ngày trước. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
spring-cloud/spring-cloud-gateway#3463 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
waiting for feedback
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
spring-cloud/spring-cloud-gateway#4394 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spring-cloud/spring-cloud-gateway
Issue tương tự
-
area:cpan-port area:performance bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#2230 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
federicoiosue/Omni-Notes#1044 ·
-
Industrial Center Text TypoĐang mởBug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày