Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support flow control behavior customization #3193

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

z-soulx
Copy link

@z-soulx z-soulx commented Aug 4, 2023

Describe what this PR does / why we need it

支持流量控制行为定制,提高灵活性

Does this pull request fix one issue?

feature:#3189

Describe how you did it

1 扩展ControlBehavior 枚举行为,FlowRule.class新增public 方法,设置控制行为器
2 扩展com.alibaba.csp.sentinel.slots.block.flow.FlowRuleUtil#generateRater 方法

Describe how to verify it

单元测试:com.alibaba.csp.sentinel.slots.block.flow.FlowRuleCheckerTest#testCustomTrafficShapingController

Special notes for reviews

@CLAassistant
Copy link

CLAassistant commented Aug 4, 2023

CLA assistant check
All committers have signed the CLA.

@sczyh30
Copy link
Member

sczyh30 commented Aug 4, 2023

Hi, could you please sign the CLA here: https://cla-assistant.io/alibaba/Sentinel?pullRequest=3193

@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Aug 4, 2023
@z-soulx
Copy link
Author

z-soulx commented Aug 4, 2023

Hi, could you please sign the CLA here: https://cla-assistant.io/alibaba/Sentinel?pullRequest=3193

agreed

@z-soulx
Copy link
Author

z-soulx commented Aug 16, 2023

已修复不兼容历史FlowRule对比问题 @sczyh30 幸苦

@sczyh30
Copy link
Member

sczyh30 commented Aug 16, 2023

Hi, could you please sign the CLA here: https://cla-assistant.io/alibaba/Sentinel?pullRequest=3193

这个需要点进去用 GitHub 登录后点击 sign 哈,目前状态好像还没同步过来。

@z-soulx
Copy link
Author

z-soulx commented Aug 16, 2023

Hi, could you please sign the CLA here: https://cla-assistant.io/alibaba/Sentinel?pullRequest=3193

这个需要点进去用 GitHub 登录后点击 sign 哈,目前状态好像还没同步过来。

找到原因,已修复,幸苦

@z-soulx z-soulx force-pushed the enhanceControlBehavior branch 2 times, most recently from 601938b to 41b8e57 Compare August 16, 2023 12:05
@z-soulx
Copy link
Author

z-soulx commented Aug 17, 2023

 Error:  Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.588 s <<< FAILURE! - in com.alibaba.csp.sentinel.demo.quarkus.GreetingResourceTest
Error:  testSentinelJaxRsQuarkusAdapter  Time elapsed: 1.058 s  <<< FAILURE!
java.lang.AssertionError: 
1 expectation failed.
Expected status code <429> but was <200>.

	at com.alibaba.csp.sentinel.demo.quarkus.GreetingResourceTest.testSentinelJaxRsQuarkusAdapter(GreetingResourceTest.java:45)

求助,
1 上午现象:我拉了master复现,发现该测试单元还是报错,不能理解,从单元测试的代码中查看,/hello/txt 没有限流配置,永远不可能429。并且master 也不通过。
2 中午现象:本地单元测试通过,无任何修改
3 mvn clean后 继续错误,两种现象反复
但是CI还是不行,不知道我遗漏了什么,特来求助 @sczyh30

@z-soulx
Copy link
Author

z-soulx commented Nov 27, 2023

@sczyh30 @LearningGp 抱歉,关于支持流量控制行为定制,提高灵活性的这个pr,我提交几个月了,没有反馈,不知是否我步骤有误或存在其它问题?

@LearningGp LearningGp added the to-review To review label Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement. to-review To review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants