alibaba / alibaba/Sentinel

Use degraderule and add exception rate equals 1.0,it's invalid

Open
#2,155 0 comments 0 reactions 0 assignees View on GitHub
area/circuit-breaking
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

### Type:bug report
When use degraderule,add exception rate equals 1.0,it's invalid。
And when I view the source code,it's:
**double curCount = errCount;
if (strategy == DEGRADE_GRADE_EXCEPTION_RATIO) {
// Use errorRatio
curCount = errCount * 1.0d / totalCount;
}
if (curCount > threshold) {
transformToOpen(curCount);
}
}**
so it will not greater than 1,and the value [0.0-1.0] make any means?

2、use jdk1.8,sentinel 1.8.0,windows10

Contributor guide

Open the contributing guide

Research direction

Start by tracing the degraderule exception-ratio path shown in the issue, including the calculation of curCount and the threshold comparison. Reproduce the behavior with JDK 1.8 and Sentinel 1.8.0 using an exception rate of 1.0, then verify the intended [0.0-1.0] threshold semantics and add coverage for the clarified behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.