MVC Spring Retry based retry filter never retries on exceptions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java, spring, spring-boot
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 4.9k
- フォーク
- 3.5k
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
spring-cloud/spring-cloud-gateway のほかの issue
-
waiting-for-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
spring-cloud/spring-cloud-gateway#4395 ·
メンテナーはふだん 1 日以内に返信
-
RequestRateLimiterGatewayFilterFactory commits 429 response instead of throwing対応中かも @seonwooj0810 が 175 日前に担当しました。 オープンwaiting-for-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
spring-cloud/spring-cloud-gateway#4175 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add @Order annotation to gatewayRestClientCustomizer Bean対応中かも @CheHyeonYeong が 247 日前に担当しました。 オープンenhancement help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
spring-cloud/spring-cloud-gateway#3626 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Ambiguity in section 19 of the documentation - Spring Cloud Gateway - Custom Route Predicate対応中かも @won-seoop が 173 日前に担当しました。 オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
spring-cloud/spring-cloud-gateway#3463 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
waiting for feedback
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
spring-cloud/spring-cloud-gateway#4394 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
spring-cloud/spring-cloud-gateway の issue をすべて見る
似ている issue
-
area:cpan-port area:performance bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#2230 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
federicoiosue/Omni-Notes#1044 ·
-
Bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信