Commit Graph

281 Commits

Author SHA1 Message Date
Eric Zhao 6135ff290a Bump version to 1.8.3
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-12-31 14:46:52 +08:00
Eric Zhao 51b21921f5 Bump version to 1.8.3-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-12-22 14:48:43 +08:00
wucheng1997 3e9f42efce
Fix QPS mode of system rule: use passQps instead of successQps and support batchCount (#2455) 2021-11-23 10:16:47 +08:00
brotherlu-xcq 25651de09a
Add metric exporter extension for exporting Sentinel metrics via JMX (#2275)
* Expose the MetricItem AS MBean
2021-09-15 10:03:09 +08:00
xiaojun207 38e0306f95
Remove unused code regarding sun.misc.Unsafe in util classes (#2285) 2021-07-09 23:30:54 +08:00
Eric Zhao 4498de480f Bump version to 1.8.2
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-07-05 19:59:44 +08:00
Jason Joo 0b5f6196e5 Improve performance of TimeUtil adaptively in different load conditions (#1746)
To achieve this by making TimeUtil have multiple running states:

- IDLE: Direct invocation state for idle conditions.
- RUNNING: Legacy mode for busy conditions.
- REQUEST: Temporary state from IDLE to RUNNING.

Through this design, TimeUtil won't cost much in idle systems anymore.

Signed-off-by: Jason Joo <hblzxsj@163.com>
2021-06-29 17:08:14 +08:00
SparkLee f395daf037
doc: Fix typo in comments of SphO (#2206) 2021-05-17 09:51:26 +08:00
张志勇 0d22aca591
Support config from system env in SentinelConfig and polish TransportConfig (#2154)
- An improved method for obtaining IP address and port number from containers
2021-04-27 19:42:22 +08:00
Jerry Chin 36b162cc70 Apply volatile modifier for fields in FlowRuleManager while keep concurrency semantics intact (#2107)
- Revert #1783
2021-04-27 19:38:02 +08:00
drgnchan 2f90a87cab
feat: Fix typo in FlowRuleManager and improve code with Map.computeIfAbsent in MetricTimerListener (#2110) 2021-04-07 13:43:27 +08:00
Yanming Zhou df871b0350
Simplify enums: reuse enum name and remove unnecessary code (#2032) 2021-03-04 11:56:02 +08:00
张春阳 3755d53498
doc: Fix incorrect comment of rollingCounterInSecond in StatisticNode (#2064) 2021-03-03 14:12:57 +08:00
Eric Zhao fca70646ad Bump version to 1.8.2-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-02-04 16:45:40 +08:00
Eric Zhao ae214b5244 Bump version to 1.8.1
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-02-04 15:30:44 +08:00
Eric Zhao 33570dad40 Polish SpiLoader and SentinelConfig
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2021-02-04 14:36:11 +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
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
brothelul a343873c81
Support setting flush interval of the metric log via SentinelConfig property (#1919) 2020-12-31 16:28:44 +08:00
brothelul b2502326cd
doc: Fix incorrect comment in FlowRuleComparator (#1915) 2020-12-18 14:54:54 +08:00
zcai2 6f7d4d09e2
test: Fix potential flaky test cases in TracerTest (#1859) 2020-11-27 09:52:14 +08:00
Lynx 6f2f844726
Fix the problem that requests will never be blocked when slowRatioThreshold = 100% (#1779) 2020-11-05 20:35:09 +08:00
Jason Joo d510eb6cd3
test: Fix overrunning test `FlowRuleManagerTest.testLoadAndGetRules` (#1823)
Signed-off-by: Jason Joo <hblzxsj@163.com>
2020-10-29 14:22:36 +08:00
Weihua c00f946813 Fix potential concurrency issue when updating flow rules (#1783) 2020-10-09 09:54:02 +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 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
yunfeiyanggzq 75f138821d Add attributes of cluster concurrency limiting in ClusterFlowConfig
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-09-16 11:38:58 +08:00
M4Y 10aa39f822
doc: Fix typo in code comments (#1721) 2020-09-10 22:59:45 +08:00
mikawudi d5eb5f473f
Pre-calculate intervalInSecond in LeapArray to reduce redundant calculation (#1700) 2020-08-27 19:47:35 +08:00
ZhiQiang Gu b91305a903
Fix typo in CircuitBreakingIntegrationTest (#1688)
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-08-21 15:10:53 +08:00
Eric Zhao e58267012d Bump version to 1.8.1-SNAPSHOT
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-08-21 14:36:49 +08:00
Eric Zhao d17bf8c7cc Bump version to 1.8.0
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-08-20 19:47:20 +08:00
Eric Zhao 125996d4d1 Add RuntimeException converting method in BlockException and polish logic for validation
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-08-20 10:22:07 +08:00
Eric Zhao a88288715a Refactor extended MetricExtension interface (matching events in Sentinel)
- Unify the extended interface as a few event handlers: onPass, onBlocked, onComplete and onError
- Polish related code

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-08-19 10:23:20 +08:00
Bill Yip 8643dac943
Add extended interface for metric extension hook to support distinguishing traffic type (#1665)
- Add EntryType args to all hook methods
2020-08-18 16:55:30 +08:00
Eric Zhao dae4621e6e Refactor exit handler mechanism of Entry
- Rename: whenComplete -> whenTerminate
- Execute the exit handler directly after the onExit hook of all slots

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-08-18 16:42:58 +08:00
Eric Zhao 55e038cc33 Polish CircuitBreaker interface and update comments
- Only carry context in tryPass/onComplete method (this might be generic in upcoming versions)

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-08-18 15:31:35 +08:00
Jason Joo ee2772b513
Fix the bug of circuit breaker half-open state transformation when request is blocked by upcoming rules (#1645)
* Refactor the workflow to fix the bug that circuit breaker may remain half-open state forever when the request is blocked by upcoming rules: revert the state change in exit handler (as a temporary workaround)
* Add exit handler in Entry as a per-invocation hook.
2020-08-18 11:04:48 +08:00
M4Y 10c92e69a2
Optimize the order of slots in ProcessorSlot SPI config (#1649) 2020-08-17 10:38:24 +08:00
Peine c5da3faad9
Polish boolean checking in test cases and dashboard (#1664) 2020-08-12 20:34:22 +08:00
Eric Zhao a18ef7cbfa Remove deprecated passCheck() in Rule and polish interface
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-08-05 10:42:15 +08:00
Eric Zhao 07b811196b Update test cases for circuit breaking
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-07-30 19:00:13 +08:00
Eric Zhao c0c27c86b7 Refactor degrade hierarchy with new circuit breaker mechanism and improve strategy
* Add `CircuitBreaker` abstraction (with half-open state) and add circuit breaker state change event observer support.
* Improve circuit breaking strategy (avg RT → slow request ratio) and make statistics of each rule dependent (to support arbitrary statistic interval).
* Add simple "trial" mechanism (aka. half-open).
* Refactor mechanism of metric recording and state change handling for circuit breakers: record RT and error when requests have completed (i.e. `onExit`, based on #1420).

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-07-30 19:00:13 +08:00
ZhiQiang Gu bd29e046e1
Add unit test for logging/TokenBucket (#1504)
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-05-29 15:57:38 +08:00
于玉桔 6b86721b36
Support setting class-level defaultFallback for annotation extension (#1493) 2020-05-29 13:49:00 +08:00
ZhiQiang Gu 2e64d33085
test: Add test cases for Tuple2 (#1501)
Signed-off-by: yunfeiyanggzq <yunfeiyang@buaa.edu.cn>
2020-05-25 13:44:54 +08:00
pleasecheckhere2016 5523fd0d42
Add exceptionPredicate in Tracer for customized exception filtering logic (#1496) 2020-05-21 15:17:19 +08:00
Eric Zhao 99d4355318 Polish code comments of the fundamental Sph/SphO/SphU class
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-05-11 17:45:48 +08:00
Eric Zhao 516e36fd83 Polish Tracer with entry.setError(ex) mechanism
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-04-28 10:11:17 +08:00
Eric Zhao 7f3165740a Refactor the mechanism of recording error in Entry and StatisticSlot
* Also polish related complete callbacks

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
2020-04-28 10:11:17 +08:00