Git Product home page Git Product logo

alibaba / sentinel Goto Github PK

View Code? Open in Web Editor NEW
22.0K 789.0 7.9K 8.02 MB

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)

Home Page: https://sentinelguard.io/

License: Apache License 2.0

Java 90.24% JavaScript 5.07% HTML 3.59% CSS 1.07% Dockerfile 0.02% Shell 0.01% Starlark 0.01%
alibaba java microservice circuit-breaker rate-limiting reliability cloud-native microservices resiliency

sentinel's Introduction

Sentinel: The Sentinel of Your Microservices

Sentinel Logo

Sentinel CI Codecov Maven Central License Gitter Leaderboard

Introduction

As distributed systems become increasingly popular, the reliability between services is becoming more important than ever before. Sentinel takes "flow" as breakthrough point, and works on multiple fields including flow control, traffic shaping, concurrency limiting, circuit breaking and system adaptive overload protection, to guarantee reliability and resilience for microservices.

Sentinel has the following features:

  • Rich applicable scenarios: Sentinel has been wildly used in Alibaba, and has covered almost all the core-scenarios in Double-11 (11.11) Shopping Festivals in the past 10 years, such as “Second Kill” which needs to limit burst flow traffic to meet the system capacity, message peak clipping and valley fills, circuit breaking for unreliable downstream services, cluster flow control, etc.
  • Real-time monitoring: Sentinel also provides real-time monitoring ability. You can see the runtime information of a single machine in real-time, and the aggregated runtime info of a cluster with less than 500 nodes.
  • Widespread open-source ecosystem: Sentinel provides out-of-box integrations with commonly-used frameworks and libraries such as Spring Cloud, gRPC, Apache Dubbo and Quarkus. You can easily use Sentinel by simply add the adapter dependency to your services.
  • Polyglot support: Sentinel has provided native support for Java, Go, C++ and Rust.
  • Various SPI extensions: Sentinel provides easy-to-use SPI extension interfaces that allow you to quickly customize your logic, for example, custom rule management, adapting data sources, and so on.

Features overview:

features-of-sentinel

The community is also working on the specification of traffic governance and fault-tolerance. Please refer to OpenSergo for details.

Documentation

See the Sentinel Website for the official website of Sentinel.

See the 中文文档 for document in Chinese.

See the Wiki for full documentation, examples, blog posts, operational details and other information.

Sentinel provides integration modules for various open-source frameworks (e.g. Spring Cloud, Apache Dubbo, gRPC, Quarkus, Spring WebFlux, Reactor) and service mesh. You can refer to the document for more information.

If you are using Sentinel, please leave a comment here to tell us your scenario to make Sentinel better. It's also encouraged to add the link of your blog post, tutorial, demo or customized components to Awesome Sentinel.

Ecosystem Landscape

ecosystem-landscape

Quick Start

Below is a simple demo that guides new users to use Sentinel in just 3 steps. It also shows how to monitor this demo using the dashboard.

1. Add Dependency

Note: Sentinel requires JDK 1.8 or later.

If you're using Maven, just add the following dependency in pom.xml.

<!-- replace here with the latest version -->
<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-core</artifactId>
    <version>1.8.7</version>
</dependency>

If not, you can download JAR in Maven Center Repository.

2. Define Resource

Wrap your code snippet via Sentinel API: SphU.entry(resourceName). In below example, it is System.out.println("hello world");:

try (Entry entry = SphU.entry("HelloWorld")) {
    // Your business logic here.
    System.out.println("hello world");
} catch (BlockException e) {
    // Handle rejected request.
    e.printStackTrace();
}
// try-with-resources auto exit

So far the code modification is done. We've also provided annotation support module to define resource easier.

3. Define Rules

If we want to limit the access times of the resource, we can set rules to the resource. The following code defines a rule that limits access to the resource to 20 times per second at the maximum.

List<FlowRule> rules = new ArrayList<>();
FlowRule rule = new FlowRule();
rule.setResource("HelloWorld");
// set limit qps to 20
rule.setCount(20);
rule.setGrade(RuleConstant.FLOW_GRADE_QPS);
rules.add(rule);
FlowRuleManager.loadRules(rules);

For more information, please refer to How To Use.

4. Check the Result

After running the demo for a while, you can see the following records in ~/logs/csp/${appName}-metrics.log.{date} (When using the default DateFileLogHandler).

|--timestamp-|------date time----|-resource-|p |block|s |e|rt  |occupied
1529998904000|2018-06-26 15:41:44|HelloWorld|20|0    |20|0|0   |0
1529998905000|2018-06-26 15:41:45|HelloWorld|20|5579 |20|0|728 |0
1529998906000|2018-06-26 15:41:46|HelloWorld|20|15698|20|0|0   |0
1529998907000|2018-06-26 15:41:47|HelloWorld|20|19262|20|0|0   |0
1529998908000|2018-06-26 15:41:48|HelloWorld|20|19502|20|0|0   |0
1529998909000|2018-06-26 15:41:49|HelloWorld|20|18386|20|0|0   |0

p stands for incoming request, block for blocked by rules, s for success handled by Sentinel, e for exception count, rt for average response time (ms), occupied stands for occupiedPassQps since 1.5.0 which enable us booking more than 1 shot when entering.

This shows that the demo can print "hello world" 20 times per second.

More examples and information can be found in the How To Use section.

The working principles of Sentinel can be found in How it works section.

Samples can be found in the sentinel-demo module.

5. Start Dashboard

Note: Java 8 is required for building or running the dashboard.

Sentinel also provides a simple dashboard application, on which you can monitor the clients and configure the rules in real time.

dashboard

For details please refer to Dashboard.

Trouble Shooting and Logs

Sentinel will generate logs for troubleshooting and real-time monitoring. All the information can be found in logs.

Bugs and Feedback

For bug report, questions and discussions please submit GitHub Issues.

Contact us via Gitter or Email.

Contributing

Contributions are always welcomed! Please refer to CONTRIBUTING for detailed guidelines.

You can start with the issues labeled with good first issue.

Enterprise Service

If you need Sentinel enterprise service support (Sentinel 企业版), or purchase cloud product services, you can join the discussion by the DingTalk group (34754806). It can also be directly activated and used through the microservice engine (MSE 微服务引擎) provided by Alibaba Cloud.

Credits

Thanks Guava, which provides some inspiration on rate limiting.

And thanks for all contributors of Sentinel!

Who is using

These are only part of the companies using Sentinel, for reference only. If you are using Sentinel, please add your company here to tell us your scenario to make Sentinel better :)

Alibaba Group AntFin Taiping Renshou 拼多多 爱奇艺 Shunfeng Technology 二维火 Mandao 文轩在线 客如云 亲宝宝 金汇金融 闪电购

sentinel's People

Contributors

albumenj avatar anilople avatar brotherlu-xcq avatar canglang1973 avatar carpenterlee avatar cdfive avatar codingsinger avatar dependabot[bot] avatar haojunren avatar icodening avatar jasonjoo2010 avatar jiangzian avatar kexianjun avatar learninggp avatar linlinisme avatar liqiangz avatar liyangsir avatar luoxn28 avatar mjaow avatar nick-tan avatar robberphex avatar sczyh30 avatar seasidesky avatar talshalti avatar tigermoon avatar waveszh avatar wuwen5 avatar yikangfeng avatar yunfeiyanggzq avatar zhaoyuguang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sentinel's Issues

熔断功能即使没有超时也会被间断性的全部cut

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

验证熔断功能的时候发现即使没有超时也会被熔断,sentinel-dubbo-adapter版本为0.1.0,sentinel-core版本也是0.1.0。
熔断设置:服务端设置Count为1,Grade为DEGRADE_GRADE_RT,TimeWindow为10。
dubbo的服务端设置默认timeout为500ms,然后通过客户端来发送请求(没有超时,不会被熔断的)。
测试发现的结果如下,每隔1s左右给服务端发送一个请求,刚开始的几个请求是ok的,然后接下来的10s左右的请求都是被熔断的,然后接下来的几秒钟的请求又是OK的,然后接下来的10s左右的请求又被熔断了。
1
PersonId:1, PersonName:张三, PersonAge: null, Time: 2018-08-06 02:25:09

1
PersonId:1, PersonName:张三, PersonAge: null, Time: 2018-08-06 02:25:11
....
PersonId:1, PersonName:张三, PersonAge: null, Time: 2018-08-06 02:25:13
1
PersonId:1, PersonName:张三, PersonAge: null, Time: 2018-08-06 02:25:14
1
......
1
com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method get in the service com.ctrip.framework.cdubbo.demo2.api.HelloBOMService. Tried 1 times of the providers [10.32.21.132:20880] (1/3) from the registry 0.0.0.0:9090 on the consumer 10.32.21.115 using the dubbo version 2.0.1. Last error is: com.alibaba.csp.sentinel.slots.block.degrade.DegradeException
at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:101)
at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:232)
at com.ctrip.framework.cdubbo.internal.delegate.client.CDubboClusterInvokerDelegate.invoke(CDubboClusterInvokerDelegate.java:40)
at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:70)
at com.ctrip.framework.cdubbo.internal.delegate.callback.StreamIdAttachInvoker.invoke(StreamIdAttachInvoker.java:39)
at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:51)
at com.alibaba.dubbo.common.bytecode.proxy0.get(proxy0.java)
at com.ctrip.framework.cdubbo.demo2.xml.client.DubboConsumer.invoke(DubboConsumer.java:61)
at com.ctrip.framework.cdubbo.demo2.xml.client.DubboConsumer.main(DubboConsumer.java:50)
Caused by: com.alibaba.csp.sentinel.slots.block.SentinelRpcException: com.alibaba.csp.sentinel.slots.block.degrade.DegradeException
Caused by: com.alibaba.csp.sentinel.slots.block.degrade.DegradeException
1
PersonId:1, PersonName:张三, PersonAge: null, Time: 2018-08-06 02:25:25
......
PersonId:1, PersonName:张三, PersonAge: null, Time: 2018-08-06 02:25:31
1
com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method get in the service com.ctrip.framework.cdubbo.demo2.api.HelloBOMService. Tried 1 times of the providers [10.32.21.115:20880] (1/3) from the registry 0.0.0.0:9090 on the consumer 10.32.21.115 using the dubbo version 2.0.1. Last error is: com.alibaba.csp.sentinel.slots.block.degrade.DegradeException
at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:101)
at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:232)
at com.ctrip.framework.cdubbo.internal.delegate.client.CDubboClusterInvokerDelegate.invoke(CDubboClusterInvokerDelegate.java:40)
at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:70)
at com.ctrip.framework.cdubbo.internal.delegate.callback.StreamIdAttachInvoker.invoke(StreamIdAttachInvoker.java:39)
at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:51)
at com.alibaba.dubbo.common.bytecode.proxy0.get(proxy0.java)
at com.ctrip.framework.cdubbo.demo2.xml.client.DubboConsumer.invoke(DubboConsumer.java:61)
at com.ctrip.framework.cdubbo.demo2.xml.client.DubboConsumer.main(DubboConsumer.java:50)
Caused by: com.alibaba.csp.sentinel.slots.block.SentinelRpcException: com.alibaba.csp.sentinel.slots.block.degrade.DegradeException
Caused by: com.alibaba.csp.sentinel.slots.block.degrade.DegradeException

Describe what you expected to happen

服务端没有处理超时,也没有异常,不应该被熔断,所有请求都应该是正常返回的。

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

  1. 引入sentinel-core:0.1.0, sentinel-dubbo-adapter:0.1.0版本。
  2. 应用启动时,配置了降级的规则如下。
    List rules = new ArrayList();
    DegradeRule rule = new DegradeRule();
    rule.setResource("xxx");
    // set threshold rt, 10 ms
    rule.setCount(1);
    rule.setGrade(RuleConstant.DEGRADE_GRADE_RT);
    rule.setTimeWindow(10);
    rules.add(rule);
    DegradeRuleManager.loadRules(rules);
  3. 服务端设置默认的超时时间为500ms

Tell us your environment

Anything else we need to know?

大致看了下导致这个问题的原因。
首先,本地请求量很小,但是DegradeRule的passCheck的clusterNode.avgRt()返回了很大的rt,有时3600,有时4900等。
然后,passCount就会开始计数,RT_MAX_EXCEED_N是个常量5,所以很容易就超过了。
最后,就会触发ResetTask,并且把cut设置为了true,然后就会导致接下来10s的所有请求都失败了。
最后的最后,10s之后会启动ResetTask,又把cut设置回false,然后请求又进来了。

public boolean passCheck(Context context, DefaultNode node, int acquireCount, Object... args) {

if (cut) {
    return false;
}

if (grade == RuleConstant.DEGRADE_GRADE_RT) {
    double rt = clusterNode.avgRt();
    if (rt < this.count) {
        return true;
    }

    // Sentinel will degrade the service only if count exceeds.
    if (passCount.incrementAndGet() < RT_MAX_EXCEED_N) {
        return true;
    }
} else {
    double exception = clusterNode.exceptionQps();
    double success = clusterNode.successQps();
    if (success == 0) {
        return true;
    }

    if (exception / success < count) {
        return true;
    }
}

synchronized (lock) {
    if (!cut) {
        // Automatically degrade.
        cut = true;
        ResetTask resetTask = new ResetTask(this);
        pool.schedule(resetTask, timeWindow, TimeUnit.SECONDS);
    }

    return false;
}

}

然后又看了下为啥clusterNode.avgRt()返回的数字很大。
这个值是从StatisticNode的avgRt方法返回,这个方法又是通过ArrayMetric的rt()拿到最终的值,rt又是根据window的rt.sum汇总而来。
如下,显示了被更新过的windowWrap的内存值(4900明显大于我设置的1,所以导致了计数,然后就是设置为cut,再然后就是全部熔断)。
window = {WindowWrap@134592}
windowLength = 1000
windowStart = 1533537600000
value = {Window@135195}
pass = {LongAdder@135439} "0"
block = {LongAdder@135440} "0"
exception = {LongAdder@135441} "0"
rt = {LongAdder@135437} "0"
success = {LongAdder@135442} "0"
minRt = {LongAdder@135443} "4900"

InitExecutor may repeat "doInit"

InitExecutor#doInit() may be executed repeatedly.

we can do this to avoid repeat doInit.

private static AtomicBoolean initialized = new AtomicBoolean(false);
...
public static void doInit() {
  if (!initialized.compareAndSet(false, true)) {
       return;
  }
  ...
}

Separate rule action from rule definition

Issue Description

Type: enhancement

Describe what feature you want

Separate rule action (passCheck) from rule definition (Rule entity).

  • FlowRule
  • DegradeRule (a temporary solution is to abstract a CircuitBreaker)
  • AuthorityRule
  • ParamFlowRule

Support customized log directory and configuration properties directory

目前启动配置项如果走配置文件只能${home}/logs/csp/${project.name}.properties路径下,log文件输出也是在${home}/logs/csp/下面
1.看是否可以整合到具体项目配置文件中去
2.看是否支持自定义路径,配置文件和log文件路径等。
主要由于当前公司环境部署集中化部署,且多个环境在一个服务器。

能不能开个钉钉群啊

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

Describe what you expected to happen

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

Tell us your environment

Anything else we need to know?

Code compilation error

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

sentinel-dashboard
0.1.0
/sentinel-dashboard/src/main/java/com/taobao/csp/sentinel/dashboard/metric/MetricFetcher.java
line number 303 and 320
The method getResource() is undefined for the type MetricNode

Tell us your environment

java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

Anything else we need to know?

maven build failure and java.lang.NoClassDefFoundError Exception found

Issue Description

Type: bug report

maven build failure

After cloning and importing as a maven project, I used command "maven package" then the console output is maven build failed and java.lang.NoClassDefFoundError Exception found. The complete output is

`D:\intellij_workspace_test\Sentinel>mvn package
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.alibaba.csp:sentinel-dashboard:jar:0.2.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ line 119, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.0
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 0
[INFO] os.detected.classifier: windows-x86_64
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] sentinel-parent
[INFO] sentinel-core
[INFO] sentinel-extension
[INFO] sentinel-datasource-extension
[INFO] sentinel-datasource-nacos
[INFO] sentinel-datasource-zookeeper
[INFO] sentinel-datasource-apollo
[INFO] sentinel-annotation-aspectj
[INFO] sentinel-transport
[INFO] sentinel-transport-common
[INFO] sentinel-transport-simple-http
[INFO] sentinel-transport-netty-http
[INFO] sentinel-adapter
[INFO] sentinel-web-servlet
[INFO] sentinel-dubbo-adapter
[INFO] sentinel-grpc-adapter
[INFO] sentinel-dashboard
[INFO] sentinel-demo
[INFO] sentinel-demo-basic
[INFO] sentinel-demo-dynamic-file-rule
[INFO] sentinel-demo-rocketmq
[INFO] sentinel-demo-dubbo
[INFO] sentinel-demo-nacos-datasource
[INFO] sentinel-demo-zookeeper-datasource
[INFO] sentinel-demo-apollo-datasource
[INFO] sentinel-demo-annotation-spring-aop
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sentinel-parent 0.2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.1:prepare-agent (default) @ sentinel-parent ---
[INFO] argLine set to -javaagent:C:\Users\ritu\.m2\repository\org\jacoco\org.jacoco.agent\0.8.1\org.jacoco.agent-0.8.1-runtime.jar=destfile=D:\intellij_workspace_test\Sentinel\target\jacoco.exec
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.1:report (report) @ sentinel-parent ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sentinel-core 0.2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.1:prepare-agent (default) @ sentinel-core ---
[INFO] argLine set to -javaagent:C:\Users\ritu\.m2\repository\org\jacoco\org.jacoco.agent\0.8.1\org.jacoco.agent-0.8.1-runtime.jar=destfile=D:\intellij_workspace_test\Sentinel\sentinel-core\target\jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sentinel-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\intellij_workspace_test\Sentinel\sentinel-core\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ sentinel-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 116 source files to D:\intellij_workspace_test\Sentinel\sentinel-core\target\classes
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[105,38] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[301,34] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[325,28] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[327,28] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[332,60] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[333,40] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[335,33] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/statistic/base/Stripe64.java:[337,45] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[199,34] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[202,27] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[214,28] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[216,28] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[221,83] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[223,36] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[224,39] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[WARNING] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/EagleEyeCoreUtils.java:[224,60] sun.misc.Unsafe是内部专用 API, 可能会在未来发行版中删除
[INFO] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/AbstractRule.java: D:\intellij_workspace_test\Sentinel\sentinel-core\src\main\java\com\alibaba\csp\sentinel\slots\block\AbstractRule.java使用了未经检查或不安全的操作。
[INFO] /D:/intellij_workspace_test/Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/AbstractRule.java: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ sentinel-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\intellij_workspace_test\Sentinel\sentinel-core\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ sentinel-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ sentinel-core ---
[INFO] Surefire report directory: D:\intellij_workspace_test\Sentinel\sentinel-core\target\surefire-reports


T E S T S

Running com.alibaba.csp.sentinel.base.metric.ArrayMetricTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.149 sec
Running com.alibaba.csp.sentinel.base.metric.WindowLeapArrayTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.39 sec
Running com.alibaba.csp.sentinel.ContextTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.108 sec
Running com.alibaba.csp.sentinel.RecordLogTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.685 sec
Running com.alibaba.csp.sentinel.slots.block.degrade.DegradeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.346 sec
Running com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.052 sec <<< FAILURE!
testStrategy(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest) Time elapsed: 0.039 sec <<< ERROR!
java.lang.ExceptionInInitializerError
at com.alibaba.csp.sentinel.config.SentinelConfig.loadProps(SentinelConfig.java:62)
at com.alibaba.csp.sentinel.config.SentinelConfig.(SentinelConfig.java:49)
at com.alibaba.csp.sentinel.node.metric.MetricWriter.(MetricWriter.java:48)
at com.alibaba.csp.sentinel.node.metric.MetricTimerListener.(MetricTimerListener.java:32)
at com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager.(FlowRuleManager.java:65)
at com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest.testStrategy(FlowPartialIntegrationTest.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1

^
at java.util.regex.Pattern.error(Pattern.java:1957)
at java.util.regex.Pattern.compile(Pattern.java:1704)
at java.util.regex.Pattern.(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at java.lang.String.split(String.java:2380)
at java.lang.String.split(String.java:2422)
at com.alibaba.csp.sentinel.util.AppNameUtil.resolveAppName(AppNameUtil.java:78)
at com.alibaba.csp.sentinel.util.AppNameUtil.(AppNameUtil.java:59)
... 35 more

testStrategy_chain(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
at com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest.testStrategy_chain(FlowPartialIntegrationTest.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testQPSGrade(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest) Time elapsed: 0.007 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
at com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest.testQPSGrade(FlowPartialIntegrationTest.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testFlowRule_other(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest) Time elapsed: 0.001 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
at com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest.testFlowRule_other(FlowPartialIntegrationTest.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testThreadGrade(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
at com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest.testThreadGrade(FlowPartialIntegrationTest.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testOriginFlowRule(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
at com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest.testOriginFlowRule(FlowPartialIntegrationTest.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running com.alibaba.csp.sentinel.slots.block.flow.FlowRuleTest
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.003 sec <<< FAILURE!
testOrigin(com.alibaba.csp.sentinel.slots.block.flow.FlowRuleTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
at com.alibaba.csp.sentinel.slots.block.flow.FlowRule.selectNodeByRequesterAndStrategy(FlowRule.java:209)
at com.alibaba.csp.sentinel.slots.block.flow.FlowRule.passCheck(FlowRule.java:156)
at com.alibaba.csp.sentinel.slots.block.flow.FlowRuleTest.testOrigin(FlowRuleTest.java:166)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running com.alibaba.csp.sentinel.slots.block.flow.PaceControllerTest
pass:6
block4
done10
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.005 sec
Running com.alibaba.csp.sentinel.slots.block.flow.WarmUpControllerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 100.049 sec
Running com.alibaba.csp.sentinel.slots.block.flow.WarmUpFlowTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.002 sec <<< FAILURE!
testWarmupFlowControl(com.alibaba.csp.sentinel.slots.block.flow.WarmUpFlowTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
at com.alibaba.csp.sentinel.slots.block.flow.WarmUpFlowTest.testWarmupFlowControl(WarmUpFlowTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running com.alibaba.csp.sentinel.slots.block.system.SystemRuleTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.064 sec
Running com.alibaba.csp.sentinel.slots.nodeselector.NodeSelectorTest
Multiple entries: entry
Single entry: entry
Single entry: entry_multiple_another
Single entry: entry_multiple_one
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.048 sec
Running com.alibaba.csp.sentinel.SphOTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec
Running com.alibaba.csp.sentinel.SphUTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.062 sec

Results :

Tests in error:
testStrategy(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest)
testStrategy_chain(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest): Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
testQPSGrade(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest): Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
testFlowRule_other(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest): Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
testThreadGrade(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest): Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
testOriginFlowRule(com.alibaba.csp.sentinel.slots.block.flow.FlowPartialIntegrationTest): Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
testOrigin(com.alibaba.csp.sentinel.slots.block.flow.FlowRuleTest): Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager
testWarmupFlowControl(com.alibaba.csp.sentinel.slots.block.flow.WarmUpFlowTest): Could not initialize class com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager

Tests run: 51, Failures: 0, Errors: 8, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] sentinel-parent .................................... SUCCESS [ 0.742 s]
[INFO] sentinel-core ...................................... FAILURE [02:08 min]
[INFO] sentinel-extension ................................. SKIPPED
[INFO] sentinel-datasource-extension ...................... SKIPPED
[INFO] sentinel-datasource-nacos .......................... SKIPPED
[INFO] sentinel-datasource-zookeeper ...................... SKIPPED
[INFO] sentinel-datasource-apollo ......................... SKIPPED
[INFO] sentinel-annotation-aspectj ........................ SKIPPED
[INFO] sentinel-transport ................................. SKIPPED
[INFO] sentinel-transport-common .......................... SKIPPED
[INFO] sentinel-transport-simple-http ..................... SKIPPED
[INFO] sentinel-transport-netty-http ...................... SKIPPED
[INFO] sentinel-adapter ................................... SKIPPED
[INFO] sentinel-web-servlet ............................... SKIPPED
[INFO] sentinel-dubbo-adapter ............................. SKIPPED
[INFO] sentinel-grpc-adapter .............................. SKIPPED
[INFO] sentinel-dashboard ................................. SKIPPED
[INFO] sentinel-demo ...................................... SKIPPED
[INFO] sentinel-demo-basic ................................ SKIPPED
[INFO] sentinel-demo-dynamic-file-rule .................... SKIPPED
[INFO] sentinel-demo-rocketmq ............................. SKIPPED
[INFO] sentinel-demo-dubbo ................................ SKIPPED
[INFO] sentinel-demo-nacos-datasource ..................... SKIPPED
[INFO] sentinel-demo-zookeeper-datasource ................. SKIPPED
[INFO] sentinel-demo-apollo-datasource .................... SKIPPED
[INFO] sentinel-demo-annotation-spring-aop ................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:09 min
[INFO] Finished at: 2018-08-09T14:02:22+08:00
[INFO] Final Memory: 24M/286M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project sentinel-core: There are test failures.
[ERROR]
[ERROR] Please refer to D:\intellij_workspace_test\Sentinel\sentinel-core\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :sentinel-core`

What I expect is maven build successfully

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

  1. import project as a maven project
  2. execute "maven package" in directory "Sentinel"

Tell us your environment

maven version: 3.3.9
maven repository config:
<repository> <id>central repository</id> <name>central</name> <url>http://central.maven.org/maven2/</url> <layout>default</layout> <!--<snapshotPolicy>always</snapshotPolicy>--> </repository>

jdk version: 1.8
IDE: intellij
Sentinel version: 0.2.0-SNAPSHOT

Anything else we need to know?

I found the parent pom.xml missing some dependencies with group "org.apache.maven.plugins" which version is 3.0.1. However, I found them in central maven repository. Their artifactId are as follows:maven-javadoc-plugin,maven-gpg-plugin.

Node lost in invocation chain of nested resources

问题

如果存在资源嵌套访问,有节点丢失

dubbo服务端代码

@Service("helloService")
public class HelloServiceImpl implements HelloService {
    public String query(String param) {
        return "Hello well come" + getTest1(param);
    }

    public String setName(String param) {
        return "Test:"+getTest1(param) +getTest2(param);
    }

    private String getTest1(String param){
        Entry entry = null;
        // 务必保证finally会被执行
        try {
            // 资源名可使用任意有业务语义的字符串
            entry = SphU.entry("test1");
            //nothing to do
            getTest2(param);
        } catch (BlockException e1) {
            // 资源访问阻止,被限流或被降级
            // 进行相应的处理操作
        } finally {
            if (entry != null) {
                entry.exit();
            }
        }
        return param;
    }


    private String getTest2(String param){
        Entry entry = null;
        // 务必保证finally会被执行
        try {
            // 资源名可使用任意有业务语义的字符串
            entry = SphU.entry("test2");
            //nothing to do
        } catch (BlockException e1) {
            // 资源访问阻止,被限流或被降级
            // 进行相应的处理操作
        } finally {
            if (entry != null) {
                entry.exit();
            }
        }
        return param;
    }
}

运行环境

dubbo+springBoot+sentinel-dubbo-adapter(0.1.1-SNAPSHOT)

预期结果

getTest1中调用getTest2(test1资源中要嵌套test2),预期结果如下:
com.zxp.spring.demo.service.HelloService:setName(java.lang.String)
++test2
++test1
++++test2

实际结果

访问setName,结果如下,与预期不符:
default

properties加载建议?

根据代码可以看到是拿的${appName}.properties文件中的配置.
但是这个appName要从JVM属性上拿, 实在不太方便...
咱们可以考虑像Spring或者Dubbo一样, 默认就去拿application.properties或者dubbo.properties吗?
或者最好的就是提供JavaConfig方案?我们就可以想在哪里写配置都行了.

    private static void loadProps() {
        // Resolve app name.
        AppNameUtil.resolveAppName();
        try {
            String appName = AppNameUtil.getAppName();
            if (appName == null) {
                appName = "";
            }
            // We first retrieve the properties from the property file.
            String fileName = LogBase.getLogBaseDir() + appName + ".properties";
            File file = new File(fileName);
            if (file.exists()) {
                RecordLog.info("read SentinelConfig from " + fileName);
                FileInputStream fis = new FileInputStream(fileName);
                Properties fileProps = new Properties();
                fileProps.load(fis);
                fis.close();

                for (Object key : fileProps.keySet()) {
                    SentinelConfig.setConfig((String)key, (String)fileProps.get(key));
                    try {
                        String systemValue = System.getProperty((String)key);
                        if (!StringUtil.isEmpty(systemValue)) {
                            SentinelConfig.setConfig((String)key, systemValue);
                        }
                    } catch (Exception e) {
                        RecordLog.info(e.getMessage(), e);
                    }
                    RecordLog.info(key + " value: " + SentinelConfig.getConfig((String)key));
                }
            }
        } catch (Throwable ioe) {
            RecordLog.info(ioe.getMessage(), ioe);
        }

        // JVM parameter override file config.
        for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) {
            SentinelConfig.setConfig(entry.getKey().toString(), entry.getValue().toString());
        }
    }

[Feature] Flow control for Netflix Zuul 1.x

Issue Description

Type: feature request

Describe or what feature you want

Integrate Sentinel with Netflix Zuul so that we can provide out-of-box flow control ability for Zuul (1.x and 2.x). Moreover, we may support more open-source API Gateways.

Code comment and document refinement

Issue Description

注释编写语言集中,中英文混合看的别扭,sentinel-core中的eagleeye没任何注释,理解费劲
Type: bug report or feature request
feature request

Describe what happened (or what feature you want)

每个类加点注释说明

Describe what you expected to happen

每个单独的java类注释规范统一下,最好是全英文或者全中文,很多带有感叹号的能处理下最好了,看着别扭

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

  1. WarmUpController的coolDownTokens方法
  2. ***Exception都存在感叹号
  3. eagleeye中实现都没注释

Tell us your environment

JDK8+Windows

Anything else we need to know?

1.文档和Roadmap中的描述如果能更详细点,更有利于帮助参与建设

真实的qps有时和FlowRule中设置的qps的不一致

Describe what happened (or what feature you want)

我将wiki中的案例代码拷贝到我的IDEA中,然后稍作修改,具体如下:

public static void main(String[] args) {
        String resourceName = "helloWorld";
        initFlowRules(resourceName);

        long begin = System.currentTimeMillis();
        long end = begin + 1000;
        int success = 0;
        int fail = 0;

        while (System.currentTimeMillis() < end) {
            Entry entry = null;
            try {
                entry = SphU.entry(resourceName);
                success++;
            } catch (BlockException e1) {
                fail++;
            } finally {
                if (entry != null) {
                    entry.exit();
                }
            }
        }

        System.out.println("Begin time: " + begin);
        System.out.println("End time: " + end);
        System.out.println("Success: " + success);
        System.out.println("Fail: " + fail);
        System.exit(0);
    }

    private static void initFlowRules(String name){
        List<FlowRule> rules = new ArrayList<>();
        FlowRule rule = new FlowRule();
        rule.setResource(name);
        rule.setGrade(RuleConstant.FLOW_GRADE_QPS);
        // Set limit QPS to 20.
        rule.setCount(20);
        rules.add(rule);
        FlowRuleManager.loadRules(rules);
    }

Describe what you expected to happen

初始化FlowRule时,设置的qps为20,我期待程序运行结束后,success输出的值也应该为20,
然而实际运行过程中,日志显示success的值 有时为20,有时为40.

Begin time: 1533132761258
End time: 1533132762258
Success: 40
Fail: 140633

DEGRADE_GRADE_RT模式的熔断规则,关于准降级状态后续request

Issue Description

Type: feature request

Describe what happened (or what feature you want)

关于wiki中“准降级状态”后的描述是:

平均响应时间 (DEGRADE_GRADE_RT):当资源的平均响应时间超过阈值(DegradeRule 中的 count,以 ms 为单位)之后,资源进入准降级状态。接下来如果持续进入 5 个请求,它们的 RT 都持续超过这个阈值,那么在接下的时间窗口(DegradeRule 中的 timeWindow,以 s 为单位)之内,对这个方法的调用都会自动地返回。


             if(this.grade == 0) {
                    exception = (double)clusterNode.avgRt();
                    if(exception < this.count) {
                        return true;
                    }

                    if(this.passCount.incrementAndGet() < 5L) {
                        return true;
                    }
                }

但是在验证该功能时,应该是后续的4个请求如果都超过阈值,接下来的时间窗口内,方法都会降级。
这里是否统一下?

规则datasource 存储

个人觉得默认加参数得形式,自动选择存储方式比较好,而不是要自己添加类来指定数据源地址,都不知道自己写在哪里合适

黑白名单 AuthorityRule 的场景考虑

对于黑白名单,是否考虑支持下面的几种场景,或许是否有必要考虑未来支持呢?
对于场景1~2可能比较简单,就是如何设置同级的App、IP黑名单/白名单
对于场景3也比较简单,就是不同级的黑名单如何设置。
对于场景4,主要是为了让用户简单,不知道是否可以支持,或者有必要支持。
对于场景5,主要就是一个配置可能要表达两种不同的意义,要么生效的是操作(覆盖服务级),要么就是生效操作+服务级,这个可能不太好弄。

场景1:
假如,服务有100个method,这100个method不允许App1和IP1访问。
场景2:
假如,服务有100个method,这100个method只允许App1和IP1访问。
场景3:
假如,服务有100个method,前99个method不允许App1访问,第100个不允许IP1访问。

场景4 :
假如,服务有100个method,其中99个method只有App1和App2不能访问,第100个method只能被IP1(不属于App1和App2)访问。出于用户简单考虑,可能需要设置服务级的黑名单,操作级给第100个method设置白名单,是否需要考虑支持这种情况呢。
场景5:
假如,服务有100个method,其中99个method只有App1和App2才能访问,第100个method只有IP1才能访问。出于对用户简单的考虑,可能需要设置服务级的白名单,操作级给第100个method也是设置白名单?如果是的话,IP1属于App1的话,就应该是第100个method只有IP1才能访问。如果IP1属于App3的话,可能用户又是希望允许App1和App2和IP1访问?

move datasource to core

Issue Description

Type: bug report or feature request

Describe what happened

Describe what you expected to happen

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

Tell us your environment

Anything else we need to know?

客户端连接控制台端口问题

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

同一台机器 (springboot+dubbo)
consumer :-Dcsp.sentinel.dashboard.server=localhost:8080 -Dproject.name=bos-web-provider -Dcsp.sentinel.api.port=8719
provider : -Dcsp.sentinel.dashboard.server=localhost:8080 -Dproject.name=bos-app-provider -Dcsp.sentinel.api.port=8720
引入包

com.alibaba.csp
sentinel-dubbo-adapter
${sentinel.adapter.version}


com.alibaba.csp
sentinel-transport-simple-http
${sentinel.http.version}

通过控制台显示,只显示了1个应用的信息,机器端口号为8719
如果不设置-Dcsp.sentinel.api.port=8720,能显示两个,但是配置限流规则后,flowRules只有在provider端能看到,consumer端flowRules为空

Describe what you expected to happen

通过端口,针对不同的应用配置对应的生效的限流规则

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

Tell us your environment

Anything else we need to know?

关于Sentinel 关于动态规则问题

用了下dashboard 和 sentinel-dubbo-adapter, 目前的dashboard 是利用 推的方式将rule 推送到服务器节点的sentinel,同时wiki 中也有提到通过实现 DataSource 接口来实现规则持久化存储,原文描述如下:

虽然目前控制台使用内存态直接设置客户端规则,但实现 DataSource 接口是更加可靠的做法。当我们通过控制台设置规则后,控制台可以将规则推送到统一的规则中心,客户端监听规则中心实时获取变更

从运维的角度,相当于在控制台 和 sentinel 客户端之间又多了一个 rule 的数据源。而且这个数据源是和控制台 、client 都存在依赖关系。 如果是一个高可用服务提供者,就面临着我必须对 rule 数据源做高可用设计,否则一旦rule 数据源宕机后,sentinel 控制台和 client 都会受到影响。
能否考虑 sentinel 控制台,rule 数据源和 client 之间只做单向依赖,减少运维风险?

Error occurs in sentinel-dashboard frontend

Issue Description

前端页面出现报错信息

Describe what happened (or what feature you want)

按照正常启动Application后,访问localhost:8080.直接进入到页面中,点击搜索后,出现一个无标题选项,点击展开后报错

Describe what you expected to happen

如果无应用,则直接不显示就好了。

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

  1. 不运行任何关联sentinel应用
  2. 直接启动dashboard
  3. 进入到页面
  4. 点击搜索
  5. 点击左侧菜单空白框,出现菜单
  6. 点击子菜单,无反应,控制台报错

Tell us your environment

windows7

Anything else we need to know?

图片

[RFC] Add support for asynchronous invocation

Motivation

The invocation chain (Context) of Sentinel does not work well with asynchronous invocation, leading to incorrect context and response.

Target

Support asynchronous invocation.

Solution

  • AsyncEntry
  • Context switching

在监控过程中调整流控规则,实时监控监控图中b_qps Y坐标显示错乱

Issue Description

Type: bug report

Describe what happened (or what feature you want)

在监控过程中调整流控规则,实时监控监控图中b_qps Y坐标显示错乱

Describe what you expected to happen

1、启动dubbo适配器,初始单机阈值为10
2、启动dubbo 消费者发送数据
3、在发送过程中将单机阈值调为80,b_qps显示错乱,p_qps正常

sentinel支持springmvc dubbo tomcat下部署进行流控吗?

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

Describe what you expected to happen

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

Tell us your environment

Anything else we need to know?

Wanted: Who is using Sentinel

(English version is below)

谁在使用 Sentinel

首先诚挚地感谢每一位持续关注并使用 Sentinel 的朋友。我们会持续投入,力图把 Sentinel 变得更好,把 Sentinel 社区和生态变得更加繁荣。

此 Issue 的目的

  • 聆听社区的声音,让 Sentinel 变得更好
  • 吸引更多的人参与贡献
  • 更多的了解 Sentinel 的实际使用场景,以方便下一步的规划

我们期待您能提供

在此提交一条评论,评论内容包括:

  • 您所在公司、学校或组织
  • 您所在的城市、国家
  • 您的联系方式:微博、邮箱、微信、钉钉号 (至少一个;有钉钉号也可附加上钉钉号,我们对企业用户会有特别的追踪)
  • 您将 Sentinel 用于哪些业务场景

您可以参考下面的样例来提供您的信息:

* 组织:阿里巴巴
* 地点:**杭州
* 联系方式:[email protected]
* 场景:内部服务稳定性保障

再次感谢您的参与!!!
Sentinel 团队


Who is using Sentinel

First of all, thanks sincerely for constantly using and supporting Sentinel. We will try our best to keep Sentinel better, and keep community and eco-system growing.

The purpose of this issue

  • We’d like to listen to the community to make Sentinel better.
  • We want to attract more people to contribute to Sentinel.
  • We're willing to learn more Sentinel use scenarios for better planning.

What we expect from you

Please submit a comment in this issue to include the following information:

  • Your company, school or organization.
  • Your city and country.
  • Your contact info: blog, email or Twitter (at least one).
  • For what business scenario do you use Sentinel.

You can refer to the following sample answer for the format:

* Organization: Alibaba
* Location: Hangzhou, China
* Contact: [email protected]
* Purpose: High-available protection and monitoring for microservices.

Thanks again for your participation!
Sentinel Community

[BUG]Sentinel控制台新增系统规则提示失败

Issue Description

Type: bug report

Describe what happened (or what feature you want)

Sentinel控制台新增系统规则提示失败
default

Describe what you expected to happen

期望在没有系统规则时,可以新增系统规则成功。

Tell us your environment

任何环境

no left menu

Issue Description

No left menu at the first page after the application started normally without exception. There was only a "首页" in the left menu.

Type: bug report

Describe what happened (or what feature you want)

maven build successfully, view the application first page that can be shown without complete left menu.

Describe what you expected to happen

The left menu can be shown normally.

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

  1. mvn clean package -Dmaven.test.skip=true
  2. java -jar sentinel-dashboard.jar -Dcsp.sentinel.dashboard.server = localhost:8080
  3. view "localhost:8080" in chrome

Tell us your environment

java version : 1.8
maven : 3.3.9
system platform : windows 10 professional
chrome version : 66.0.3359.139

Anything else we need to know?

关于线程限流问题的讨论

Issue Description

bug report

Describe what happened (or what feature you want)

sentinel采用类似于责任链的设计模式,将统计、限流、降级、监控等功能串起来,使每个环节自责更清晰(见DefaultSlotsChainBuilder),这种设计模式对于大多数关于“数量”的统计场景是没问题的,比如QPS、错误量等。但对于线程数限流(即并发限流)这样做是有问题的,详见:https://blog.csdn.net/manzhizhen/article/details/81413014。

在Sentinel中,当前服务对线程数加(请求进来)和减(请求执行完毕)的操作是在StatisticSlot中完成的:

@Override
public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count, Object... args) throws Throwable {

        // 注意: 其他代码省略
        fireEntry(context, resourceWrapper, node, count, args);
        **node.increaseThreadNum();**
}

@Override
public void exit(Context context, ResourceWrapper resourceWrapper, int count, Object... args) {
        DefaultNode node = (DefaultNode)context.getCurNode();
        // 注意: 其他代码省略
        **node.decreaseThreadNum();**
}

而线程数的限流操作是在另一个类来做的,例如SystemSlot

@Override
public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count, Object... args)  throws Throwable {
    **SystemRuleManager.checkSystem(resourceWrapper);**
    fireEntry(context, resourceWrapper, node, count, args);
}

其中SystemRuleManager.checkSystem的操作如下:
public static void checkSystem(ResourceWrapper resourceWrapper) throws BlockException {

    // 注意: 其他代码省略
    // total thread
    int currentThread = Constants.ENTRY_NODE == null ? 0 : Constants.ENTRY_NODE.curThreadNum();
    **if (currentThread > maxThread) {
        throw new SystemBlockException(resourceWrapper.getName(), "thread");
    }**
}

将统计和限流分开的这种方式,无法真正做到线程数量(也就是并发度)的精准控制,会有竞态条件产生,比较好的做法是用信号量来实现。

Describe what you expected to happen

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

Tell us your environment

Anything else we need to know?

配置dashboard参数,接口无法调通问题

Issue Description

Type: bug report

Describe what happened (or what feature you want)

我配置了dashboard的参数,希望能够看到请求的可视化。此时调用其他服务的接口失败。
失败直接原因是:NoClassDefFoundError: Could not initialize class com.alibaba.csp.sentinel.Constants
出错行:master分支 com.alibaba.csp.sentinel.context.ContextUtil 的 113行 Constants.ROOT.addChild(node);

#33 33 ## Describe what you expected to happen
希望在配置了 dashboard 参数后能够调通接口(配置前,能够调通接口)

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

1、引入sentinel-dubbo-adapter,sentinel-transport-simple-http,dubbo
2、配置dashboard的参数 ##便可复现

#33 ## Tell us your environment
dubbo.version 2.6.0
sentinel.version 0.1.1-SNAPSHOT or 0.1.0
csp.sentinel.dashboard.server=http://localhost:8080
csp.sentinel.api.port=8878
csp.sentinel.heartbeat.interval.ms=20
csp.sentinel.metric.file.single.size=52428800
csp.sentinel.metric.file.total.count=6

Anything else we need to know?

本人新手,希望验证这个issue的时候,大神先自己直接配置一遍走一遍,也许是我本身配置的问题。

Extensible rule manager and processor slot chain

Issue Description

可动态的增加管理器manager和增删减processor chain
Type: bug report or feature request
【feature】

Describe what happened (or what feature you want)

可扩展的处理manager和slot chain

Describe what you expected to happen

像跳表那般能快速走完processor slot chain

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

Tell us your environment

Anything else we need to know?

qps heartbeat info was lost when using sentinel-transport-simple-http

Issue Description

Type: bug report

Describe what happened (or what feature you want)

当使用sentinel-transport-simple-http 模块进行适配时。
我设置qps限流为20,当使用Apache ab持续压测的时候,我得到了如下的图形
image
请求是持续的,看metrics.log是上报出线了中断
image
如图,20:51:04 到20:51:17之间没有metrics信息

Describe what you expected to happen

按正常情况应该是连续的曲线

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

Tell us your environment

Anything else we need to know?

Fallback support for Dubbo

目前从源码看到只是抛出Exception,不支持自定义fallback方法:
建议支持到方法级别的fallback,是否可以考虑约定大于配置的方式来定义fallback

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.