Commit Graph

36 Commits

Author SHA1 Message Date
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
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
Roger3581321 ca13ea6a2a
Use CopyOnWriteArraySet for ConnectionGroup#connectionSet to avoid iterator fast-fail (#2559) 2022-02-07 10:38:23 +08:00
wutingjia 9a612508ff Make all backend thread pools daemon (#2181)
* feat:make command center thread daemon
* feat:make all NamedThreadFactory thread daemon
2021-06-04 13:33:46 +08:00
Eric Zhao fefd8c4826 Use JDK 1.8 native LongAdder instead and remove legacy LongAdder
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-02-04 10:21:40 +08:00
Eric Zhao be2715d814 Update source/target JDK version to 1.8 and update documents
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-02-04 10:21:40 +08:00
cdfive 62efb78d4e
Refactor SpiLoader and enhance SPI mechanism (#1383)
* Add `@Spi` annotation as the general annotation for SPI definition.
* Add isDefault in @Spi, add loadDefaultInstance and improve loadFirstInstanceOrDefault method, improve test cases
* Add SpiLoaderException class for thrown when something goes wrong while loading Provider
* Rearrange packages of base SPI mechanism

NOTE: this PR contains breaking changes regarding API.
2021-01-27 09:45:56 +08:00
nickChenyx cc2d1a69a9
Optimize logging statements using placeholder (#1736)
* Optimize logging statements using placeholder to avoid unnecessary concatenation (issue #1735)
2020-09-17 20:42:01 +08:00
yunfeiyanggzq 10e6e8dcf6 Add unit tests for cluster concurrent limiting checker
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-09-16 11:42:59 +08:00
yunfeiyanggzq 6314caab80 Add basic cluster concurrency limiting impl in token server module
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-09-16 11:41:18 +08:00
yunfeiyanggzq 473cc84262 Add concurrency token request/release operation in TokenService
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-09-16 11:40:14 +08:00
cj dbbed35cc4
Remove unused code in TokenServerHandler#channelActive (#1667)
Signed-off-by: cj <power4j@outlook.com>
2020-08-13 14:47:57 +08:00
ZhiQiang Gu 17c3ff7a44
test: Add unit test for sentinel-cluster-server and polish code (#1529)
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-07-23 10:15:01 +08:00
ZhiQiang Gu c7949f5f4e
Fix incorrect protocol description in FlowRequestData writer/decoder (#1607)
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-07-16 15:48:18 +08:00
Eric Zhao eed77cafc2
Polish placeholders in logging content to slf4j convention (#1342)
* Polish placeholders in logging content to "{}"

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-03-17 11:11:54 +08:00
Eric Zhao b0905547ff Use ServiceLoaderUtil to create SPI ServiceLoader
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-10-23 19:20:53 +08:00
changxing.yu 17365f3d5f Fix the bug of getting the wrong current flow QPS in ClusterFlowChecker (#972) 2019-08-12 13:47:15 +08:00
Eric Zhao 7997cf65fc
Fix the numeric overflow bug of ping response data in the cluster module (#844)
- Change type of cluster ping data response from byte to int. This change is compatible with old versions

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-06-18 15:11:05 +08:00
Bo Zhang a3369378ad Apply Alibaba p3c pmd plugin/rules and fix/ignore all violations of priority 1 (#574) 2019-03-15 09:24:39 +08:00
Eric Zhao 044cdbb1bf
Add occupy mechanism for future buckets of sliding window to support "prioritized requests final pass" (#568)
* Rename: MetricsLeapArray -> BucketLeapArray
* Add implementation for `FutureBucketLeapArray`, a kind of `BucketLeapArray` that only reserves for future buckets, which is used for calculating occupied future tokens.
* Add OccupiableBucketLeapArray that combines common BucketLeapArray with FutureBucketLeapArray. The rollingNumberInSecond in StatisticNode now uses OccupiableBucketLeapArray by default.
* Add OccupySupport interface. Node now implements OccupySupport interface.
* Add occupy-related methods in Metric and ArrayMetric.
* Handle prioritized requests in default traffic shaping controller.
* Update default occupyTimeout to 500ms

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-14 10:04:56 +08:00
逅弈 59d923ebc1 Add an ApiCommandHandler to list all available commands and description (#491)
* Add a ApiCommandHandler which fetch all registered CommandHandlers so that user can get all available CommandHandlers by request /api
* Add a customized CommandHandler demo
2019-03-01 13:39:50 +08:00
Eric Zhao 094ba3bfba Carry appName in FetchClusterServerInfo command
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-03-01 09:45:54 +08:00
Eric Zhao f7c08df5c1
Fix bug of calculating param size and amount in ParamFlowRequestDataWriter of Sentinel cluster (#495)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-02-20 14:00:14 +08:00
Eric Zhao ee4a0d43a1 Improve and fix bugs for ConnectionManager and add test cases
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-31 14:25:01 +08:00
Eric Zhao cd02fad290 Fix NPE bug when creating connection group in ConnectionManager
- The NPE will occur when multiple threads are trying to create the connection group for the same namespace

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-31 14:25:01 +08:00
Eric Zhao f27d7a4b24 Improve ClusterServerConfigManager in sentinel-cluster-server-default and add basic test cases
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-30 16:41:39 +08:00
Eric Zhao cd334406af Code and javadoc refinement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-28 16:22:34 +08:00
Eric Zhao f82fcd696f Add basic monitoring command API for cluster token server
- Also add top-K frequent parameter statistic support

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:38:17 +08:00
Eric Zhao 1b68d0c9a0 Polish cluster token server handler related logic
- Enlarge retry timeout to 2s by default
- Improve remote address representation

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:36:46 +08:00
Eric Zhao e4d0f4c6ab Improve namespace register logic for embedded token server mode
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:35:22 +08:00
Eric Zhao 99bdb9cf3c
Add total QPS limit control for specific namespace in cluster flow control (#382)
- Add `UnaryLeapArray` and `RequestLimiter` to enable simple QPS limit
- Improve cluster rule manager and server config manager to support request limiter
- Support `TOO_MANY_REQUEST` status in client side
- Also improve the automatic namespace register of embedded server mode

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2019-01-04 14:09:15 +08:00
Eric Zhao 96dac7a1e0 Update constructor of Sentinel cluster server statistic component
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-24 18:02:50 +08:00
Eric Zhao 2735954afd Update cluster related command APIs and some enhancement and fix for cluster module
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:54:30 +08:00
Eric Zhao a731811d27 Polish default cluster server module for initial work
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao 9d42edcffa Add cluster token server interface to core and support embedded mode
- Add a EmbeddedClusterTokenServer interface

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00
Eric Zhao b973aca1f5 Add implementation for default token server module
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2018-12-14 10:52:28 +08:00