alibaba / alibaba/Sentinel

Dynamic change related strategy rule do not take effect

Open
#1,212 0 comments 0 reactions 0 assignees View on GitHub
area/flow-control kind/question
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

Type: *bug report*

### Describe what happened (or what feature you want)

1. When resource flow_qps sets the rule qps to 500 and resource flow_related sets the rule qps to 200, when the true qps of flow_qps> 500, the flow_related part of the request will execute the blockHandler. When the flow_qps qps rule is dynamically set to 5000, then the real qps <5000, flow_related BlockHandler is still executed.

2. When flow_qps sets the rule qps to 500 and flow_related sets the rule qps to 200. When the true qps of flow_qps> 500, flow_related will execute the blockHandler. When the flow_related rule is dynamically set to 10, the flow_related executes the blockHandler ratio to 100%.

The code and rules are as follow:

```
@SentinelResource(value = "flow_qps", blockHandler = "blockHandler", fallback = "fallback")
@Override
public String qps(String appId, String type) {
return String.format("qps ok=>appId=%s,type=%s", appId, type);
}

@SentinelResource(value = "flow_related", blockHandler = "blockHandler", fallback = "fallback")
@Override
public String related(String appId, String type) {
return String.format("related ok=>appId=%s,type=%s", appId, type);
}

```
![image](https://user-images.githubusercontent.com/33611490/71240337-d44fc500-2343-11ea-9c0f-0c698935a27b.png)

![image](https://user-images.githubusercontent.com/33611490/71240190-758a4b80-2343-11ea-8f3b-815e064d8f01.png)

### Describe what you expected to happen

### How to reproduce it (as minimally and precisely as possible)

1. The first case flow_related returned to normal

2. The second case executes the callback as configured

### Tell us your environment

### Anything else we need to know?

Contributor guide

Open the contributing guide

Research direction

No source files, tests, or entry points are named. Reproduce the two cases with the flow_qps and flow_related resources and their dynamic QPS rules, then trace how rule changes affect related-resource blocking. Done means the first case returns normally after raising flow_qps to 5000 and the second invokes the callback at the configured ratio after lowering flow_related to 10.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.