From 6209796f94fe842af04ae0b14f5193dd86bf17a4 Mon Sep 17 00:00:00 2001 From: lepdou Date: Wed, 13 Apr 2022 14:57:33 +0800 Subject: [PATCH] fix circuitbreaker http code greater than 400 as fail response bug --- CHANGELOG.md | 1 + .../polaris/circuitbreaker/feign/PolarisFeignClient.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb6ee171a..ff140ef95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,4 @@ - [feat:add custom label resolver spi for rate limit](https://github.com/Tencent/spring-cloud-tencent/pull/105) - [feat:fix discovery weight param not set to register request bug](https://github.com/Tencent/spring-cloud-tencent/pull/102) - [Bugfix: fix causing cpu 100% when set ScheduledThreadPoolExecutor corePoolSize=0](https://github.com/Tencent/spring-cloud-tencent/pull/98) +- [Bugfix: fix circuitbreaker http code greater than 400 as fail response bug](https://github.com/Tencent/spring-cloud-tencent/pull/116) diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java index 0170fc344..bb061b3b7 100644 --- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java +++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java @@ -56,8 +56,8 @@ public class PolarisFeignClient implements Client { final ServiceCallResult resultRequest = createServiceCallResult(request); try { Response response = delegate.execute(request, options); - // HTTP code greater than 400 is an exception - if (response.status() >= 400) { + // HTTP code greater than 500 is an exception + if (response.status() >= 500) { resultRequest.setRetStatus(RetStatus.RetFail); } return response;