apache / apache/servicecomb-java-chassis

[BUG] - Edge服务不能执行自定义流控Handler

Open
#4,929 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1.9k
Forks
814
Avg merge
8d 23h
Merged PRs (30d)
1

Description

### Steps to Reproduce

1. 自定义流控handler:provider-service-handler
2. Edge服务配置Provider handler对所有待转发的请求(转发至多个不同微服务)进行流控控制

### Expected Behavior

自定义流控未执行

### Servicecomb Version

2.9.0

### Additional Context

AbstractRestInvocation中checkQpsFlowControl只能执行CSE自带的ProviderQpsFlowControlHandler,不能执行自定义的流控handler,且函数为private,也不能通过自定义子类覆盖
`private Holder checkQpsFlowControl(OperationMeta operationMeta) {
Holder qpsFlowControlReject = new Holder<>(false);
@SuppressWarnings("deprecation")
Handler providerQpsFlowControlHandler = operationMeta.getProviderQpsFlowControlHandler();
if (null != providerQpsFlowControlHandler) {
try {
providerQpsFlowControlHandler.handle(invocation, response -> {
qpsFlowControlReject.value = true;
produceProcessor = ProduceProcessorManager.INSTANCE.findDefaultJsonProcessor();
sendResponse(response);
});
} catch (Throwable e) {
LOGGER.error("failed to execute ProviderQpsFlowControlHandler", e);
qpsFlowControlReject.value = true;
sendFailResponse(e);
}
}
return qpsFlowControlReject;
}`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with AbstractRestInvocation.checkQpsFlowControl and the provider handler configuration described in the issue. Reproduce the Edge service scenario on ServiceComb 2.9.0 with a custom provider-service-handler forwarding requests to multiple services. Done means the configured custom flow-control handler is invoked instead of only the built-in ProviderQpsFlowControlHandler.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.