Skip to content

fix: allow regex resource names with all control behaviors#3619

Open
EvanYao826 wants to merge 1 commit into
alibaba:1.8from
EvanYao826:fix/regex-control-behavior
Open

fix: allow regex resource names with all control behaviors#3619
EvanYao826 wants to merge 1 commit into
alibaba:1.8from
EvanYao826:fix/regex-control-behavior

Conversation

@EvanYao826
Copy link
Copy Markdown

Issue Description

Fixes #3544

Previously, regex resource names were only allowed with CONTROL_BEHAVIOR_DEFAULT (fast failure). This restriction prevented users from using warm-up or queue behaviors with regex-matched resources.

Changes

In FlowRuleUtil.checkRegexField(), removed the control behavior restriction for regex rules. Now regex resource names can be used with any control behavior (DEFAULT, WARM_UP, RATE_LIMITER, WARM_UP_RATE_LIMITER), as long as the rule is not in cluster mode.

Before:

if (rule.isRegex()) {
    return !rule.isClusterMode() && rule.getControlBehavior() == RuleConstant.CONTROL_BEHAVIOR_DEFAULT;
}

After:

if (rule.isRegex()) {
    return !rule.isClusterMode();
}

Testing

Verified that flow rules with regex resource names can now be loaded with all control behaviors.

Previously, regex resource names were only allowed with
CONTROL_BEHAVIOR_DEFAULT (fast failure). This restriction
prevented users from using warm-up or queue behaviors with
regex-matched resources.

Now regex resource names can be used with any control behavior,
as long as the rule is not in cluster mode.

Fixes alibaba#3544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 资源名称使用正则表达式时,当使用非快速失败的CONTROL_BEHAVIOR时,配置的流控规则不会加载

1 participant