Commit Graph

824 Commits

Author SHA1 Message Date
dependabot[bot] bb813ddff3
build(deps-dev): Bump org.springframework:spring-expression (#3375)
Bumps [org.springframework:spring-expression](https://github.com/spring-projects/spring-framework) from 5.1.8.RELEASE to 5.2.24.RELEASE.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.1.8.RELEASE...v5.2.24.RELEASE)

---
updated-dependencies:
- dependency-name: org.springframework:spring-expression
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 21:02:44 +08:00
cdfive dbd3c06ca7
Fix when duplication spi class found using SpiLoader (#3387) 2024-04-28 09:53:01 +08:00
Robert Lu cd02b1dc8d
fix flaky tests and fix passDefaultLocalCheck (#3367)
* fix test case SentinelDubboConsumerFilterTest#testDegradeSync

* When test is run slow, count bucket will count on next time span, causing failed test.

* dos2unix ParamFlowDefaultCheckerTest.java

* fix testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads by rule.setDurationInSec(2)

* set threshold as count in 2 seconds to prevent the failure of the unit test when the unit test runs longer than 1 second.

* fix quarkus test by set /txt sleep 300

* If /txt sleep 500 ms, in testSentinelJaxRsQuarkusAdapter, may cause 2 request intervals of more than 1 s, which cause rate limit policy is not effective.

* fix testDegradeAsync

* When test is run slow, count bucket will count on next time span, causing failed test.

* use testcontainers to fix testConsulDataSourceWhenInit

* Project embedded-consul has been deprecated in favour of org.testcontainers:consul
* use consul testcontainers to fix testConsulDataSourceWhenInit, which means docker is required to run tests.
```
Error:  com.alibaba.csp.sentinel.datasource.consul.ConsulDataSourceTest.testConsulDataSourceWhenInit -- Time elapsed: 34.47 s <<< ERROR!
  com.pszymczyk.consul.EmbeddedConsulException: Could not start Consul process in 30 seconds
  	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
  	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
  	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
  	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
 ```

* introduce intermediate node to avoid ABA problem
2024-04-17 10:25:25 +08:00
Robert Lu befdc56885
fix flaky tests (#3364)
* fix ParamFlowPartialIntegrationTest

mock TimeUtil to avoid time changed, and bucket moved to next.

* remove csp.sentinel.log.output.type

remove sysprop csp.sentinel.log.output.type in TimeUtilTest,
to avoid a few outputs.

* try fix testConcurrentAcquireAndRelease

* remove stdout

remove sout in ParamFlowThrottleRateLimitingCheckerTest,
to avoid a few outputs.

* ConcurrentClusterFlowCheckerTest,djust the flowId to prevent conflicts

* CurrentConcurrencyManagerTest,adjust the flowId to prevent conflicts

* update year
2024-03-25 10:09:16 +08:00
袁世超 24c93c8a1a
replace ThreadLocal<DateFormat> with DateTimeFormatter (#3353) 2024-03-21 13:41:11 +08:00
LearningGp ffe0d1ec81
Polish CodeCov related config (#3358) 2024-03-05 13:42:31 +08:00
LearningGp e945ffc3f5
Update .codecov.yml (#3356) 2024-03-01 18:33:49 +08:00
LearningGp 5a7a31087b
Update ci.yml (#3354) 2024-03-01 18:05:18 +08:00
luyanbo 669595d6a0 add depth: 0 2024-03-01 09:58:58 +08:00
luyanbo 6c475480eb rename to package com.alibaba.csp.sentinel.adapter.spring.webmvc_v6x 2024-03-01 09:58:58 +08:00
ruansheng 0ca82b63b7 update slf4j version 2024-03-01 09:58:58 +08:00
ruansheng d1d3d36054 Add webmvc-6x-adapter module 2024-03-01 09:58:58 +08:00
Robert Lu d995dfe2e7
try fix ci (#3350) 2024-02-28 20:51:17 +08:00
Robert Lu 3b9be97e75
configure codecov (#3349) 2024-02-28 19:35:30 +08:00
Robert Lu 41569f9a41
update CONTRIBUTING.md (#3346) 2024-02-27 19:02:31 +08:00
Robert Lu ae6ebb49d0
Move document-lint from circleci to github-actions (#3345)
Move document-lint from circleci to github-actions.
Adjust document according to markdownlint-cli rules.
2024-02-21 17:05:29 +08:00
Robert Lu 03fe33ee0b
Support run test at jdk21 (#3344)
Adjust the test logic, build with jdk17, and run with jdk21 (and the original 8, 11, 17)
2024-02-20 20:58:15 +08:00
Robert Lu 8fef1b5eee
Support jdk17 (#3339)
Adjust the test logic, use jdk17 to build, 8, 11, 17 to run
2024-02-20 18:58:52 +08:00
LearningGp 2b7a989e29
Update workflows (#3325) 2024-02-01 19:45:41 +08:00
LearningGp f3fd4e6187 Bump version to 1.8.7 2023-12-28 19:32:10 +08:00
LearningGp 665fb541a7 Bump version to 1.8.7-SNAPSHOT 2023-12-28 17:48:44 +08:00
LearningGp 15bd6c62b9
Add FlowQpsRegexDemo in sentinel-demo-basic (#3296) 2023-12-28 17:44:48 +08:00
quguai c4ed9a3aba Resource rules (flow/degrade/param/authority) support regex matching (#3251) 2023-12-27 20:44:06 +08:00
karl-sy 2e18c3e916 metric: Add Prometheus exporter module for Sentinel metrics (#3173) 2023-12-27 20:43:41 +08:00
SaaiVenkat 1dea35095b Fix order dependent tests in SofaRpcFallbackRegistryTest (#3282) 2023-12-27 20:40:27 +08:00
Robert Lu 94f92ea635 make all ThreadPool static final (#3243)
* make all ThreadPool static final

* update github workflow
2023-12-27 20:40:27 +08:00
karl-sy ae42ddd35f Make default JUL-based logging asynchronous (#3136)
* fix issues/1463 : Make default JUL-based logging asynchronous
2023-12-27 20:40:27 +08:00
quguai c4997eee15 Remove the requirement of carrying batchCount and args in entry.exit() (#3114) 2023-12-27 20:40:27 +08:00
Clara Fang f991f5f8a4 Remove duplicate declaration of quarkus-arc-deployment dependency in sentinel-annotation-quarkus-adapter-deployment/pom.xml (#3101) 2023-12-27 20:40:27 +08:00
Eric Zhao 3781212f51 Fix CI: Update SentinelApacheHttpClientTest (#3133)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2023-12-27 20:40:27 +08:00
Eric Zhao 20abca7e88 ci: Fix deprecated actions runner image (#3124) 2023-12-27 20:40:27 +08:00
Eric Zhao 6534ed43dd ci: Create .github/workflows/codeql-analysis.yml 2023-12-27 20:40:27 +08:00
Eric Zhao 51e6778cf7 Update SECURITY.md 2023-12-27 20:40:27 +08:00
Eric Zhao 021f5a0c27 Create SECURITY.md 2023-12-27 20:40:27 +08:00
Robert Lu 069034cb64 doc: Update sentinel-dashboard/README.md (#3108) 2023-12-27 20:40:27 +08:00
LearningGp 0c97d8f4b1 Add basic implementation of token bucket for flow-control (#3106) 2023-12-27 20:40:27 +08:00
langshiquan 74f7d184cf Add SSL support for sentinel-datasource-redis (#3045) 2023-12-27 20:40:27 +08:00
Eric Zhao cc6923f078 doc: Update issue templates 2023-12-27 20:40:27 +08:00
Eric Zhao 4bd333f1de dashboard: Add MSE Sentinel guide in page nav-bar
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2023-12-27 20:40:27 +08:00
Eric Zhao 77ab2fd9c0 doc: Update README.md
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2023-12-27 20:40:27 +08:00
Frank Zhao 44f178639b doc: Add contribution leaderboard badge into README.md (#3029)
Signed-off-by: frank-zsy <syzhao1988@126.com>
2023-12-27 20:40:26 +08:00
pandaapo 20a6a63e0c Upgrade curator-recipes to 5.1.0 to fix API change for ZooKeeper data-source (#2963)
* Fix issue to upgrade curator-recipes and related API.
* Resolve test failure: ClassNotFoundException of ZooKeeperAdmin.
* Remove unused property in pom.
2023-12-27 20:40:26 +08:00
pandaapo 44080bc886 Fix potential connection leak bug when closing NacosDataSource (#2962) 2023-12-27 20:40:26 +08:00
温绍锦 e2580a0585 build(deps): Update protobuf & gRPC version of adapter modules to fix macOS aarch64 compile error (#2993) 2023-12-27 20:40:26 +08:00
ZhangYan 9db0c70cbb Fix thread-blocked problem of EtcdDataSource (#2991)
* fix thread blocked problem of etcd watcher

in the previous version of EtcdDataSource, when the flowRules defined in the etcd change and trigger etcd watcher, there will be a following error:
2022-12-07 14:36:03.592 [vertx-blocked-thread-checker] WARN io.vertx.core.impl.BlockedThreadChecker [?:?] -  Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 2336 ms, time limit is 2000 ms
2022-12-07 14:36:04.592 [vertx-blocked-thread-checker] WARN io.vertx.core.impl.BlockedThreadChecker [?:?] -  Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 3337 ms, time limit is 2000 ms
2022-12-07 14:36:05.592 [vertx-blocked-thread-checker] WARN io.vertx.core.impl.BlockedThreadChecker [?:?] -  Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 4337 ms, time limit is 2000 ms
2022-12-07 14:36:06.595 [vertx-blocked-thread-checker] WARN io.vertx.core.impl.BlockedThreadChecker [?:?] -  Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 5337 ms, time limit is 2000 ms
io.vertx.core.VertxException: Thread blocked
 at sun.misc.Unsafe.park(Native Method)
 at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
 at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1707)
 at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3334)
 at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1742)
 at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
 at com.htsc.fst.saas.infrastructure.component.EtcdDataSource.readSource(EtcdDataSource.java:92)
 at com.htsc.fst.saas.infrastructure.component.EtcdDataSource.readSource(EtcdDataSource.java:23)
 at com.alibaba.csp.sentinel.datasource.AbstractDataSource.loadConfig(AbstractDataSource.java:44)
 at com.htsc.fst.saas.infrastructure.component.EtcdDataSource.lambda$initWatcher$0(EtcdDataSource.java:74)
 at com.htsc.fst.saas.infrastructure.component.EtcdDataSource$$Lambda$480/1375681611.accept(Unknown Source)
 at io.etcd.jetcd.Watch$1.onNext(Watch.java:183)
 at io.etcd.jetcd.impl.WatchImpl$WatcherImpl.onNext(WatchImpl.java:310)
 at io.etcd.jetcd.impl.WatchImpl$WatcherImpl$$Lambda$488/2088661957.handle(Unknown Source

I guess the reason is : when the watcher hold etcd Client, you can't use etcd Client in the Watch's consumer function. 
Besides the problem above, use getKeyValue() in the watchEvent can reduce once invoke with etcd server to getting the latest flowRules :)

* Update EtcdDataSource.java

Add charset adaptation -- accept the suggestion from @LProDreamAll
2023-12-27 20:40:26 +08:00
quguai 59a32994cd Fix the bug that error occurs in JMX metrics exporter when resource name contains '*' (#2992) 2023-12-27 20:40:26 +08:00
Joseph Zhang 9f3712eed7 Fix NPE bug in LogSlot#entry when recording rule ID (#2980) 2023-12-27 20:40:26 +08:00
Eric Zhao e34d55273f Refactor RateLimiterController: improve accuracy and support maxQps > 1000
* Rename to ThrottlingController
* Improve accuracy: use nanoseconds when necessary and support maxQps threshold > 1000 (i.e. wait < 1ms)

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2023-12-27 20:40:26 +08:00
Eric Zhao 4e41c14514 Polish AssertUtil: add assertNotNull and assertTrue
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2023-12-27 20:40:26 +08:00
garroshh 1483669aaf Update metrics name for better monitor selection in JMX MetricBeanWriter extension (#2976) 2023-12-27 20:40:26 +08:00