Skip to content

Commit 3d08446

Browse files
committed
Fixes alibaba#128: Fix early return when exception ratio is 100%
Signed-off-by: Eric Zhao <[email protected]>
1 parent 28c1b3c commit 3d08446

File tree

1 file changed

+2
-3
lines changed
  • sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade

1 file changed

+2
-3
lines changed

sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRule.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ public int hashCode() {
153153

154154
@Override
155155
public boolean passCheck(Context context, DefaultNode node, int acquireCount, Object... args) {
156-
157156
if (cut) {
158157
return false;
159158
}
@@ -184,8 +183,8 @@ public boolean passCheck(Context context, DefaultNode node, int acquireCount, Ob
184183
}
185184

186185
double realSuccess = success - exception;
187-
if (realSuccess <= 0) {
188-
return exception < RT_MAX_EXCEED_N;
186+
if (realSuccess <= 0 && exception < RT_MAX_EXCEED_N) {
187+
return true;
189188
}
190189

191190
if (exception / success < count) {

0 commit comments

Comments
 (0)