Skip to content

Commit 2a7e8fd

Browse files
authored
fix: 优化熔断插件实现,解决用户通配API内存占用过高问题 (#538)
* fix: 优化熔断插件实现,解决用户通配API内存占用过高问题 (#533) * feat: support trace reporting * feat: restore version to 1.15.7-SNAPSHOT * feat: add initService to AssemblyAPI * test: add test for initService * fix: TraceReporterConfig type mistake * feat: support modify loglevel over parameter & support log in tracereporter * feat: 上报监控及调用链失败不抛异常 * fix: 校验失败打印端口号 * fix: add toString method to all configration classes * fix: 修复通配API导致counter及healthChecker膨胀的问题 * fix: 去掉统一的错误统计时长的配置,放回插件化配置中 * fix: 补齐测试用例 * fix: testcase failure * fix: test case failed by git test * fix: test case failed * fix: test case failure * fix: 健康检查变更影响范围过大问题 * fix: 解决探测规则生效多个的问题,只生效1个探测规则,并进行排序 * fix: 修复用例失败问题 * begin 1.15.9
1 parent 81a1d64 commit 2a7e8fd

File tree

39 files changed

+2983
-1639
lines changed

39 files changed

+2983
-1639
lines changed

polaris-circuitbreaker/polaris-circuitbreaker-api/src/main/java/com/tencent/polaris/circuitbreak/api/CircuitBreakAPI.java

+43-32
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,54 @@
1717

1818
package com.tencent.polaris.circuitbreak.api;
1919

20+
import java.io.Closeable;
21+
2022
import com.tencent.polaris.api.plugin.circuitbreaker.ResourceStat;
2123
import com.tencent.polaris.api.plugin.circuitbreaker.entity.Resource;
2224
import com.tencent.polaris.circuitbreak.api.pojo.CheckResult;
2325
import com.tencent.polaris.circuitbreak.api.pojo.FunctionalDecoratorRequest;
2426
import com.tencent.polaris.circuitbreak.api.pojo.InvokeContext;
2527

26-
public interface CircuitBreakAPI {
27-
28-
/**
29-
* check and acquire circuitbreaker
30-
*
31-
* @param resource
32-
* @return pass or not, and fallback config if needed
33-
*/
34-
CheckResult check(Resource resource);
35-
36-
/**
37-
* report the resource invoke result
38-
*
39-
* @param reportStat
40-
*/
41-
void report(ResourceStat reportStat);
42-
43-
44-
/**
45-
* make the function decorator
46-
*
47-
* @param functionalDecoratorRequest
48-
* @return decorator
49-
*/
50-
FunctionalDecorator makeFunctionalDecorator(FunctionalDecoratorRequest functionalDecoratorRequest);
51-
52-
/**
53-
* make the invoke handler
54-
* @param requestContext
55-
* @return InvokeHandler
56-
*/
57-
InvokeHandler makeInvokeHandler(InvokeContext.RequestContext requestContext);
28+
public interface CircuitBreakAPI extends AutoCloseable, Closeable {
29+
30+
/**
31+
* check and acquire circuitbreaker
32+
*
33+
* @param resource
34+
* @return pass or not, and fallback config if needed
35+
*/
36+
CheckResult check(Resource resource);
37+
38+
/**
39+
* report the resource invoke result
40+
*
41+
* @param reportStat
42+
*/
43+
void report(ResourceStat reportStat);
44+
45+
46+
/**
47+
* make the function decorator
48+
*
49+
* @param functionalDecoratorRequest
50+
* @return decorator
51+
*/
52+
FunctionalDecorator makeFunctionalDecorator(FunctionalDecoratorRequest functionalDecoratorRequest);
53+
54+
/**
55+
* make the invoke handler
56+
* @param requestContext
57+
* @return InvokeHandler
58+
*/
59+
InvokeHandler makeInvokeHandler(InvokeContext.RequestContext requestContext);
60+
61+
/**
62+
* 清理并释放资源
63+
*/
64+
void destroy();
5865

66+
@Override
67+
default void close() {
68+
destroy();
69+
}
5970
}

0 commit comments

Comments
 (0)