fix circuitbreaker http code greater than 400 as fail response bug

pull/117/head
lepdou 3 years ago
parent 7bd864077f
commit dee399818c

@ -5,3 +5,4 @@
- [feat:add custom label resolver spi for rate limit](https://github.com/Tencent/spring-cloud-tencent/pull/106) - [feat:add custom label resolver spi for rate limit](https://github.com/Tencent/spring-cloud-tencent/pull/106)
- [feat:fix discovery weight param not set to register request bug](https://github.com/Tencent/spring-cloud-tencent/pull/103) - [feat:fix discovery weight param not set to register request bug](https://github.com/Tencent/spring-cloud-tencent/pull/103)
- [Bugfix: fix causing cpu 100% when set ScheduledThreadPoolExecutor corePoolSize=0](https://github.com/Tencent/spring-cloud-tencent/pull/99) - [Bugfix: fix causing cpu 100% when set ScheduledThreadPoolExecutor corePoolSize=0](https://github.com/Tencent/spring-cloud-tencent/pull/99)
- [Bugfix: fix circuitbreaker http code greater than 400 as fail response bug](https://github.com/Tencent/spring-cloud-tencent/pull/117)

@ -56,8 +56,8 @@ public class PolarisFeignClient implements Client {
final ServiceCallResult resultRequest = createServiceCallResult(request); final ServiceCallResult resultRequest = createServiceCallResult(request);
try { try {
Response response = delegate.execute(request, options); Response response = delegate.execute(request, options);
// HTTP code greater than 400 is an exception // HTTP code greater than 500 is an exception
if (response.status() >= 400) { if (response.status() >= 500) {
resultRequest.setRetStatus(RetStatus.RetFail); resultRequest.setRetStatus(RetStatus.RetFail);
} }
return response; return response;

Loading…
Cancel
Save