NoSuchMethodError in the circuit breaker since 3.103.0 when resilience4j 2.x is on the classpath

未關閉 適合新手
#803 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
76/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
java, spring-boot

研究方向

從OciCircuitBreakerImpl.circuitBreakerCallNotPermittedErrorMessage中第261行回報的呼叫開始,檢查SDK使用的resilience4j相依性版本。確認getWaitIntervalFunctionInOpenState()是否適用於支援的版本,接著使用resilience4j 1.7.1和2.x執行斷路器測試。完成標準是:斷路器處於開啟狀態時會傳回一般的拒絕例外,且不會出現NoSuchMethodError。

由索引模型根據 Issue 內容生成。

描述

The SDK still builds against resilience4j 1.7.1, from June 2021. Spring Boot 3 applications that use Spring Cloud get resilience4j 2.x through spring-cloud-dependencies, and Maven puts only one version on the classpath.

OciCircuitBreakerImpl calls CircuitBreakerConfig.getWaitDurationInOpenState(), which resilience4j 2.0 removed. Since 3.103.0 that call runs whenever the circuit breaker is open and rejects a request. The client then throws java.lang.NoSuchMethodError instead of the usual exception for a rejected call. The same setup works on 3.102.0.

java.lang.NoSuchMethodError: 'java.time.Duration io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.getWaitDurationInOpenState()'
	at com.oracle.bmc.circuitbreaker.internal.resilience4j.OciCircuitBreakerImpl.circuitBreakerCallNotPermittedErrorMessage(OciCircuitBreakerImpl.java:261)
	at com.oracle.bmc.http.internal.ClientCall.callAsyncImpl(ClientCall.java:1141)
	at com.oracle.bmc.http.internal.ClientCall.callAsyncTokenRefresh(ClientCall.java:1068)
	at com.oracle.bmc.retrier.BmcGenericRetrier.doFunctionCall(BmcGenericRetrier.java:175)
	...
	at com.oracle.bmc.core.ComputeClient.launchInstance(ComputeClient.java:2827)

To reproduce, use oci-java-sdk-core 3.103.0 with resilience4j-circuitbreaker 2.2.0 or 2.4.0. Let calls fail until the circuit breaker opens, then make one more call.

Versions: OCI Java SDK 3.103.0 (3.102.0 works), resilience4j 2.2.0, Spring Boot 3.5.16, Java 21.

Could the SDK move to resilience4j 2.x? As a smaller step, getWaitIntervalFunctionInOpenState() exists in both 1.7.1 and 2.x and would avoid this crash.

主要語言
Java
星號
243
分支
171
平均合併
5 分鐘
30 天內合併 PR
4

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

oracle/oci-java-sdk 的其他 Issue

查看 oracle/oci-java-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。