Commit Graph

1221 Commits

Author SHA1 Message Date
Zhaohui Yu
a273705b8d
[issue #10148]Replace sync forward request with async request (#10158)
* Replace sync forward request with async request in DistroFilter. issue #10148

* extract method for config default headers

* add env switch for async distro forward.

* Fixed code review problems:
1. Move async forward switch from sys module to naming module.
2. use nacos code style to format code.

* Fixed nacos code checkstyle:
1. one import per Class
2. add javadoc

* In order to avoid additional overhead, move switch from GlobalConfig to ClientConfig and cache the env switch.

* Move switch from ClientConfig to DistroConfig.

* Removed unused import.

* Add test for async forward for DistroFilter

* Add license

* rename test method name

* Should enable async forward

* fixed test

* set async forward request switch to true in test

* fixed test: create and set property with MockEnvironment

* fixed check style

* move MockEnvironment init to BeforeClass

* add setter for asyncForwardRequest switch
2023-04-20 20:10:26 +08:00
Karson
916534ecfc
Add unit test for api module (#10316)
* add some unit test for api module.

* fix code style error
2023-04-13 19:03:55 +08:00
lllwd
2bb2b9d21d
selector avalanche protection (#10184) 2023-04-10 10:46:15 +08:00
杨翊 SionYang
ced2f1d9ed
Add unit test for api module (#10241)
* Add more situation UT for NetUtils

* Add UT for api module selector package

* Add UT for api module exception package

* Add UT for api module cmdb package
2023-03-31 16:41:11 +08:00
Karson
fe5002f485
Add some unit test for V2Controller (#10143)
* add unit test for HealthController

* for rerun ci

* add unit test for CatalogControllerV2
2023-03-21 15:28:32 +08:00
WangLiang/王良
a397c10a54
Optimize the nacos-client/pom.xml for exclude google/**/*.proto (#9982)
* Optimize the pom.xml of the nacos-client

* optimize pom

* exclude `google/**/*.proto`

* tab

* Remove dependency `io.grpc:protoc-gen-grpc-java:${version}:pom`

* revert indent

* revert native-image
2023-03-01 09:42:15 +08:00
hth
4e78a769e5
replaced report API to Grpc (#9976) 2023-02-20 09:55:34 +08:00
杨翊 SionYang
9ebf5aeade
Judge the message whether null for metadata processor. (#9951) 2023-02-15 10:39:39 +08:00
杨翊 SionYang
1ef245d058
Add Unit test for api naming remote request. (#9916)
* Add Unit test for api naming remote request.

* For checkstyle.
2023-02-08 13:30:38 +08:00
陈浩 Nineteen
8c90f892b4
fix batchRegister authentication (#9899) 2023-02-05 16:06:53 +08:00
云野
71389b0f56
add feature -- list instance record which enabled was false (#9855) 2023-02-02 10:50:16 +08:00
杨翊 SionYang
fee349b667
Fix #9861, auth check before distro filter. (#9871) 2023-01-28 11:11:29 +08:00
gongzhongqiang
708387c277
fix:replace nacos website url to https. (#9797) 2023-01-10 09:47:52 +08:00
zz630
20145fd256
enhancement: CloseableHttpAsyncClient does not clean up expired and i… (#9727)
* enhancement: CloseableHttpAsyncClient does not clean up expired and invalid connections (#9708)

* enhancement: CloseableHttpAsyncClient does not clean up expired and invalid connections (#9708)

* style:satisfy style/NacosCheckStyle.xml

* add unit test(#9708)

* Revert "add unit test(#9708)"

This reverts commit 939905cb56f30af4d0ec35543d6d630f0777eb98.

* add unit test
2023-01-05 10:04:27 +08:00
nov.lzf
69047073c6
修改长连接request response 类注册逻辑,由类扫描改成手动注册 (#9738)
* 修改request response 类加载逻辑,有类扫描改成手动注册

* 优化注册方式,直接SPI注册payload
2022-12-21 19:56:21 +08:00
杨翊 SionYang
dfcdd391af
Add auth for some v2 api. (#9671) 2022-12-08 10:31:32 +08:00
drgnchan
5be6385563
polish: reduce magic value of 'NACOS_SERVER_HEADER' (#9663) 2022-12-06 16:16:21 +08:00
nov.lzf
acc8ab46cf
Refactor connection limit module to plugin (#9653)
* 限流插件提交

* 限流插件提交

* 限流插件提交

* 限流插件重构提交

* connection control test case submit

* tps control test case submit

* tps control test case submit

* tps control test case submit

* exact model has higher priority

* exact model has higher priority

* tpsreporter

* tpsreporter

* tpsreporter

* check style

* log optimize

* interceptor

* checkstyle

* tps check

* configController query http

* rename component

* 优化参数命名

* 优化参数命名

* 优化参数命名

* 优化参数命名

* optimize connection manager

* optimize connection manager

* optimize connection manager

* optimize connection manager

* interceptor to mse

* Monitor Model

* Monitor Model

* revert opensource tps ability

* revert opensource tps ability

* revert opensource tps ability

* revert opensource tps ability

* revert opensource tps ability

* revert opensource tps ability

* opensource submit

* opensource submit

* check style

* check style

* pmd ,rat

* update db params

* test case fix

* 简化开源反脆弱实现

* test case

* test  case fix

* 修复单测

* 修复单测

* 修复单测
2022-12-06 16:15:51 +08:00
hth
0e346f0024
Code optimization, remove useless code. (#9620)
* Code optimization, remove useless code.

* code optimization
2022-11-25 14:50:44 +08:00
zz630
7ce4dcc22c
Update HttpClientManager.java (#9477)
fix #9474
2022-11-22 09:50:22 +08:00
胡俊
0f5afa8faa
解决服务元数据清理逻辑导致的反注册失败问题 https://github.com/alibaba/nacos/issues/9586 (#9587) 2022-11-17 10:40:54 +08:00
李晓双 Li Xiao Shuang
e8d71359d3
Modify the method modifier of NacosApplicationListener to default (#9460) 2022-11-04 13:54:06 +08:00
Weizhan Yun
506bc26f4d
[ISSUE #9393] 设置线程为守护线程,保证在main线程推出时应用程序能过正常关闭。 (#9396)
* 设置线程为守护线程,保证在main线程退出时应用程序能过正常关闭。

* graceful shutdown naming executetask engine.
2022-11-03 13:44:00 +08:00
KomachiSion
f56dedc7fe Fix sync connection client not removed. 2022-10-27 12:11:06 +08:00
KomachiSion
8410fbccf3 Merge remote-tracking branch 'upstream/2.2.0' into asoc2022_issue#8461
# Conflicts:
#	config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java
2022-10-25 14:52:32 +08:00
Liu Yixiao
03345fd923
[ISSUE #8461] Enhance Nacos monitor observability system (#9038)
* Enhance MetricsMonitor with several new metrics

* Add config read and write rt

* Add ServiceEvent publisher queue size

* Add fuzzy search count

* Add naming subscriber and publisher count with v1 or v2 version tag

* Add config subscriber count with v1 or v2 version tag

* Add pending push task count and empty push count metrics

* collect pending push task count by scheduled task

* add unit test for increment metrics in NacosMonitorPushResultHook

* Add topn counter container and topn config change

* Create private MeterRegistry for config change

* Add scheduled clear for config change count, add removeAll for TopnCounterMetricsContainer

* Add topn service change

* Reconstruct metrics monitor with NacosMeterRegistryCenter.

* divide globalRegistry to different modules' CompositeMeterRegistry

* Add dynamic meters refresh service for config and naming module

* fix unit test

* Add try catch when init NacosMeterRegistryCenter
2022-10-25 11:31:29 +08:00
KomachiSion
696d489423 Merge remote-tracking branch 'upstream/2.2.0' into 2.2.0-summer#8312
# Conflicts:
#	plugin/pom.xml
2022-10-24 15:37:47 +08:00
杨翊 SionYang
7a23c56822
[ISSUE#7930] 2.2.0 remove some deprecated codes (#9368)
* Remove double write switch and upgrade from 1.X switch.

* Remove IFilterConfig.java

* Remove some deprecated constants and methods

* Remove some deprecated classes in nacos-core

* Remove some deprecated config

* Remove some deprecated codes in naming module

* Remove some deprecated codes in sys module

* Fix unit test

* Try to make UdpConnectorTest pass more easier.
2022-10-21 17:44:26 +08:00
KomachiSion
f4438ac202 Follow 2.2.0 branch. 2022-10-21 15:33:04 +08:00
KomachiSion
aa6816b69f Merge remote-tracking branch 'upstream/2.2.0' into summer2022_issue#8308
# Conflicts:
#	naming/src/main/java/com/alibaba/nacos/naming/controllers/v2/InstanceControllerV2.java
#	naming/src/main/java/com/alibaba/nacos/naming/controllers/v2/ServiceControllerV2.java
#	naming/src/main/java/com/alibaba/nacos/naming/misc/UtilsAndCommons.java
2022-10-21 14:16:18 +08:00
陈浩 Nineteen
83855da734
buf fix ip count metrics (#9355)
* buf fix ip count metrics

* run ci

* run ci
2022-10-21 09:26:20 +08:00
胡俊
0bd589cb6d
[ISSUE#8857] collect client info (#9202)
* collect client info #8857

* collect client info #8857

* collect client info #8857

* collect client info #8857

* collect client info #8857

* collect client info #8857
2022-10-19 09:40:34 +08:00
杨翊 SionYang
b1ac88be78
[ISSUE#8481] Add Trace Event SPI for Naming. (#9336)
* Add Trace plugin spi.

* Add NacosCombinedTraceSubscriber

* Subscribe NamingTraceEvent when start up cluster.

* Fix test error.
2022-10-18 09:30:37 +08:00
KomachiSion
6eae075a48 Solve conflict. 2022-10-17 19:23:13 +08:00
KomachiSion
22169055ed Merge remote-tracking branch 'upstream/develop' into 2.2.0
# Conflicts:
#	naming/src/main/java/com/alibaba/nacos/naming/core/Cluster.java
2022-10-17 19:17:31 +08:00
胡俊
0834641825
[ISSUE#9323]1.x http接口服务名校验问题 (#9324)
* 1.x http接口服务名校验问题

* 1.x http接口服务名校验问题 for #9323
2022-10-14 14:34:50 +08:00
Karson
a78ee54007
[ISSUE #6876] Concurrent instance deregiste NullPointerException (#9287)
* fix issue #6876 .

* reset properties.
2022-10-10 15:20:17 +08:00
Pixy Yuan
9c771cf2c3
[ISSUE #9277] publisherIndexes clean the service key when no instances anymore. (#9278) 2022-10-10 09:51:15 +08:00
杨翊 SionYang
f272c36df7
[ISSUE#9210] ConnectionBasedClient support add revision (#9239)
* ConnectionBasedClient support add revision

* getRevision when get verifydata.
2022-09-29 15:55:43 +08:00
DongYafei
94d812a269
fix api result (#9237) 2022-09-29 10:39:23 +08:00
Pixy Yuan
af22d35d6f
[ISSUE #9230] Fix missing dependency between event publisher and subs… (#9231)
* [ISSUE #9230] Fix missing dependency between event publisher and subscriber triggered on snapshot loading.

* [ISSUE #9230] Fix codestyle.

* [ISSUE #9230] Fix missing dependency between event publisher and subscriber triggered on persistent clients' snapshot loading.

* [ISSUE #9230] Fix import.
2022-09-29 09:42:03 +08:00
Pixy Yuan
04fe7eab2f
Support client hash revision for DISTRO (#9214)
* [ISSUE #9210] Using hash as ephemeral clients' revision for DISTRO verification.

* [ISSUE #9210] Improve performance of ephemeral client hash calc.

* [ISSUE #9210] Remove calculation for ephemeral client's subscribers.

* [ISSUE #9210] Persist and sync revision for clients.

* [ISSUE #9210] Improve hash of ephemeral client.

* [ISSUE #9210] Improve performance of hash calc for clients.

* [ISSUE #9210] Make distro verification compatible with zero revision from old servers.

* [ISSUE #9210] Log clientId when VERIFY-FAILED.

* [ISSUE #9210] Fix long class cast exception to REVISION.

* [ISSUE #9210] Just renew clients when verify v2 clients on v1 mode.

* [ISSUE #9210] Add UTs for ephemeral client verification.

* [ISSUE #9210] Fix codestyle.

* [ISSUE #9210] Fix IpPortBasedClientTest.

* [ISSUE #9210] Fix codestyle.

* [ISSUE #9210] Fix license.

* [ISSUE #9210] Fix ConcurrentHashSetTest cases to verify concurrent modification properly.

* [ISSUE #9210] Fix codestyle.
2022-09-28 13:56:33 +08:00
DongYafei
0032b8cfc1
Add ClientInfoControllerV2 (#9197)
* add ClientInfoControllerV2

* rename tenant to namespaceId
2022-09-23 14:11:59 +08:00
KomachiSion
a2b997f6a7 Fix print logs for NamingTraceEvent. 2022-09-22 13:58:18 +08:00
DongYafei
6501dd8ab6
update ServiceControllerV2, add OperatorControllerV2 (#9156) 2022-09-19 11:30:14 +08:00
hoErYu
0fdfd194f9
For #9106 Remove redundant judgment of WebUtils (#9107)
* For #9106 Remove redundant judgment of WebUtils

* For #9106 Remove redundant judgment of WebUtils

* For #9106 Remove redundant judgment of WebUtils
2022-09-15 11:34:36 +08:00
DongYafei
9439250e80
[ISSUE#8308] update InstanceControllerV2 for api 2.0 (#9111)
* update InstanceControllerV2 for api 2.0

* for InstanceControllerV2, add parameter groupName for api 2.0
2022-09-15 10:47:07 +08:00
lphx
0cf9c24086
remove redundant code (#9089)
* Modifying duplicate code,remove unnecessary if

* remove [instance.getIp() + ":" + instance.getPort()] and use the original Instance.toIpAddr() method,Because their implementation is the same
2022-09-07 16:46:42 +08:00
KomachiSion
6edddcf48e Remove some v1 persistent datum processor. 2022-08-29 20:19:06 +08:00
KomachiSion
e515915895 Fix UT. 2022-08-29 20:19:06 +08:00