Commit Graph

740 Commits

Author SHA1 Message Date
blake.qiu
afe0035bb4
fix(#11032): adjust comment for RpcAckCallbackSynchronizer. (#11033) 2023-08-29 15:58:07 +08:00
Sunrisea
6c9c6957b8
[ISSUE #10734]Move the param check logic of grpc handler into the AbstractRequestFilter (#10972)
* For #10734,将grpc接口的参数请求移动到AbstractRequestFilter中实现

* For #10734,补充测试用例

* For #10734,fix code style

* For #10734,fix code style

* For #10734,fix test bug
2023-08-21 10:15:03 +08:00
ZhangShenao
65bad77274
Fix word spelling in ConnectionManager (#10966)
* Fix word spelling in `ConnectionManager`

* fix word
2023-08-17 10:42:52 +08:00
杨翊 SionYang
c4ddf1842f
Refactor Grpc Server, add transportFilter and ServerInterceptor exten… (#10970)
* Refactor Grpc Server, add transportFilter and ServerInterceptor extension.

* skip bad PMD rule.
2023-08-15 16:32:51 +08:00
Sunrisea
d756cdc6de
[ISSUE #10734] Optimize the param check implementation logic (#10955)
* For #10734,优化实现逻辑,提高扩展性,为动态变更限流规则预留接口

* For #10734,优化实现逻辑,提高扩展性,为动态变更参数校验规则预留接口
2023-08-14 14:55:49 +08:00
阿魁
fb5cfddb74
fix(distro): fix issue#10880. (#10881) 2023-08-01 15:36:12 +08:00
Sunrisea
8adca685f6
[ISSUE #10734] Refactor the ParamChecker and ParamExtractor (#10775)
* For #10734,refactor the paramextractor and ParamChecker

* For #10734,alter the rules of ParamCheck

* For #10734,alter the rules of ParamCheck

* For #10734,fix bug

* For #10734,fix bug and alter the ParamCheckRules.java

* For #10734,fix code style

* For #10734,fix the param check rules

* For #10734,implement the server param check config

* For #10734,optimize the logic

* For #10734,optimize the logic

* For #10734,optimize the logic
2023-07-19 16:34:03 +08:00
chenyiqin
318892d08d
Add the handle to overload connection (#10783)
* add the handle to overload connection

* fast return
2023-07-17 11:01:47 +08:00
杨翊 SionYang
9069730a04
Refactor grpc tls (#10759)
* Move Tls negotiator to GrpcSdkServer.

* use protocol negotiator builder replace directly create.

* use SPI load negotiator and set tls as default negotiator.

* Remove tlsconfig in BaseRpcServer.

* Add some ut.

* For checkstyle.
2023-07-11 19:10:00 +08:00
Sunrisea
cae21e2dcd
[ISSUE #10734] Implement grpc server interceptor and grpc param extractors (#10745)
* For #10734,Implement grpc server interceptor and grpc param extractors

* For #10734,add unit test for grpc server interceptor and grpc param extractors

* For #10734,alter the test case

* For #10734,delete the ConnectionSetupRequestParamExtractor
2023-07-10 14:43:51 +08:00
maoling
e7fbbc1301
improvements for leave node api and UI (#10748) 2023-07-10 13:39:22 +08:00
Sunrisea
ba8e0e2dff
[ISSUE #10734] Implemented the parameter validation utility class (#10737)
* For #10734,Refactor the AbstractConfigRequest ,move common properties from its subclasses to the parent class,to reduce the number of corresponding parameter extractors by .

* For #10734,add ParamCheckRules,ParamCheckUtils, add  ParamExtractor interface and the abstract classes HttpParamExtractor and RpcParamExtractor, implement the corresponding Manager.

* For #10734,fix codestyle

* For #10734,fix codestyle , move extractor and extractorManager to core directory

* For #10734,fix codestyle

* For #10734,fix dependency of common module

* For #10734,fix codestyle and copyright

* For #10734,fix pom codestyle and copyright

* For #10734,fix pom codestyle and copyright

* For #10734,fix  copyright

* For #10734,fix  copyright

* For #10734,fix bug caused by refactor of AbstractConfigRequest ,add ut test of ParamExtractorManager

* For #10734,fix bug caused by refactor of AbstractConfigRequest

---------

Co-authored-by: zhuoguang <sunrisea@B-Q6UQMD6R-0222.local>
2023-07-07 11:06:00 +08:00
Daydreamer-ia
d4e9b836d2 fix checkstyle and fix bug 2023-06-22 17:08:04 +08:00
Daydreamer-ia
fc3bb2f42c Merge branch 'develop' into asoc#8458.t
# Conflicts:
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	common/src/main/java/com/alibaba/nacos/common/remote/client/ConnectionEventListener.java
#	common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java
#	common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java
#	common/src/test/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClientTest.java
#	core/src/main/java/com/alibaba/nacos/core/cluster/ServerMemberManager.java
#	core/src/main/java/com/alibaba/nacos/core/remote/grpc/GrpcBiStreamRequestAcceptor.java
#	core/src/main/java/com/alibaba/nacos/core/remote/grpc/GrpcRequestAcceptor.java
2023-06-22 15:33:05 +08:00
nov.lzf
0ba772658d
replace nacos cache with guava cache (#10674)
* replace nacos cache with
guava cache tt fix memory leak

* checkstyle
2023-06-20 13:34:20 +08:00
zhanghong
38f461eb12
[ISSUE #10583]修复权限 (#10587)
* 修复权限

* 修改为console

* 修改为console
2023-06-05 17:21:05 +08:00
nov.lzf
505c90b96d
uniform config lastmodified ts & refactor config disk storage. (#10533)
* uniform cache timestamp

* uniform cache timestamp

* uniform cache timestamp

* uniform cache timestamp

* checkstyle & pmd

* revert application properties

* remove duplicate code

* checkstyle and pmd

* bug fix
2023-05-26 09:53:25 +08:00
杨翊 SionYang
cf59d62260
HessianSerializer add whitelist. (#10542) (#10546)
* HessianSerializer add whitelist. (#10542)

* HessianSerializer add whitelist.

* Handle exception in onApply and onRequest to save the stateMachine.

* Add new ut for HessianSerializer

* Fix unit test.

* For checkstyle.
2023-05-26 09:31:55 +08:00
nov.lzf
51903edd82
add out date connection active detection,expel it when client no response. (#10509)
* add out date connection active detection,expel it when client no response.

* add out date connection active detection,expel it when client no response.
2023-05-19 10:20:37 +08:00
KomachiSion
4198005529 For checkstyle and pmd. 2023-05-09 16:40:25 +08:00
KomachiSion
0555619b05 Merge remote-tracking branch 'upstream/develop' into develop#10361
# Conflicts:
#	config/src/main/java/com/alibaba/nacos/config/server/constant/Constants.java
2023-05-09 15:50:12 +08:00
KomachiSion
607074c877 Make HealthController not strongly depend config and naming module. 2023-05-09 14:43:25 +08:00
nov.lzf
dbe3730d69
fix sslconf out of date (#10451)
* 更新证书文件

* fix test case

* update ssl conf
2023-05-09 10:09:21 +08:00
KomachiSion
9d92b5122a Add NamespaceDetailInjector and move NamespaceOperationService to core module. 2023-05-09 10:05:26 +08:00
KomachiSion
e93d417de6 Move CommonPersistService impls to core module and rename to NamespacePersistService. 2023-05-08 20:42:29 +08:00
KomachiSion
515ae912b2 Move some TenantInfo and NamespaceRowMapperInjector to core module. 2023-05-08 20:29:53 +08:00
KomachiSion
841ce677d1 Move DerbySnapshotOperation and DistributedDatabaseOperateImpl to core module. 2023-05-08 19:29:14 +08:00
zhanghong
5cf5829253
add configModuleState/raftModuleState/distroModuleState in branch develop#10153 (#10288)
* add configModuleState/raftModuleState/distroModuleState

* add configModuleState/raftModuleState/distroModuleState

* update TEST

* 修复test bug

* 移除ip暴露风险
2023-05-08 18:05:34 +08:00
KomachiSion
3d4014a3d3 Move StandaloneDatabaseOperateImpl to persistent module. 2023-05-08 11:56:38 +08:00
KomachiSion
576225485e Move TimerContext to sys module and add new one single thread to snapshot for derby. 2023-04-25 14:46:38 +08:00
KomachiSion
11fc4792c4 Move namespace module to core module. 2023-04-23 16:41:43 +08:00
KomachiSion
f83061f47d Move some datasource and relative classes into persistence module. 2023-04-23 16:00:42 +08:00
杨翊 SionYang
0e0a73e025
Revert "[issue #10148]Replace sync forward request with async request (#10158)" (#10358)
This reverts commit a273705b8d.
2023-04-20 20:12:33 +08:00
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
7952543c43
Code optimization for NacosMeterRegistryCenter (#10231)
* optimize code

* add unit test

* reformat code style
2023-03-31 14:43:30 +08:00
varyuan
d291f24d88
fix bug, about Arrays.asList(new boolean[1]) (#10129) 2023-03-21 15:29:16 +08:00
nov.lzf
c39ba4a35c
ssl context reload spi (#10150) 2023-03-21 15:27:57 +08:00
nov.lzf
7df6f6d47c
dead lock on sending connection reset request on server over limit #10114 (#10149) 2023-03-21 15:13:45 +08:00
githubcheng2978
214e0c9077
nacos grpc connection supports TLS Encryption (#9980)
support tls encryption on grpc transport on client and server side

---------

Co-authored-by: githubcheng2978 <yeliang.cheng@freemud.com>
2023-03-15 09:41:25 +08:00
Gao Xuliang
5aa272c5e9
[ISSUE #10052] ServerLoaderController Code optimization (#10058) 2023-03-09 11:05:25 +08:00
ZhangShenao
d5bbe9ebfd
[ISSUE #10020] Use Generic Type When Declaring authFilterRegistration in com.alibaba.nacos.core.auth.AuthConfig (#10021)
* code optimization for `ConfigChangeHandler`

* [ISSUE #9930] fix word spelling error in com.alibaba.nacos.common.http.AbstractHttpClientFactory#ASYNC_IO_REACTOR_NAME

* [ISSUE #10020] Use Generic Type When Declaring `authFilterRegistration` in com.alibaba.nacos.core.auth.AuthConfig

* fix code format

* fix code format

* Fix Code Format

* Fix Code Format
2023-03-02 10:18:12 +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
chenyiqin
5a8f6f5f6a
Fix cluster node state error (#10011)
* Fix cluster node state error

* Fix checkstyle
2023-03-01 09:40:30 +08:00
云野
aebe583049
fix #9954 -- timeunit. (#10004) 2023-02-27 10:54:33 +08:00
贾璞
67d5acc892
[ISSUE #9965] Delete method getRemoteIp() from class NacosHttpTpsCont... (#9966)
* [ISSUE #9965] Delete method getRemoteIp() from class NacosHttpTpsControlInterceptor

* [ISSUE #9965] Supplementary deletes three extra strings
2023-02-20 10:29:16 +08:00
hth
4e78a769e5
replaced report API to Grpc (#9976) 2023-02-20 09:55:34 +08:00
杨翊 SionYang
986c024ccc
Fix Unit test problem. (#9884) 2023-02-01 14:02:00 +08:00
云野
332dc1d348
fix #9819 (#9850) 2023-01-28 10:35:57 +08:00
sixsixsix516
4fa126f7fc
Modify the return value comment of the isBasicInfoChanged method (#9849) 2023-01-16 14:02:50 +08:00
胡俊
01faa47c76
快照首次加载失败问题 (#9838) 2023-01-13 10:36:57 +08:00
云野
732e7012ab
Provide more configuration items to allow users to customize their grpc services to better optimize network performance. (#9806) 2023-01-11 09:47:15 +08:00
gongzhongqiang
708387c277
fix:replace nacos website url to https. (#9797) 2023-01-10 09:47:52 +08:00
MajorHe1
5ac56885a1
[#ISSUE 9733] return origin key if value is null in StringPool.get() (#9798) 2023-01-09 13:55:31 +08:00
Weizhan Yun
1bc2e4185e
upgrade grpc-java version to 1.50.2, (#9799)
protobuf-java  to 3.21.11, proto-google-common-protos to 2.7.1
2023-01-05 17:27:56 +08:00
Karson
7e24ab9f6c
[Enhance] Prevent double triiger ContextRefreshedEvent (#9757)
* prevent double tigger event.

* reformat code style
2023-01-03 11:36:43 +08:00
twelvet
7c4f614d51
RequestMappingHandlerMapping conflict (#9720)
RequestMappingHandlerMapping conflict
2022-12-27 15:10:11 +08:00
drgnchan
fbe7d956c5
polish:change log level warn to info when succeed (#9749) 2022-12-27 15:08:09 +08:00
nov.lzf
69047073c6
修改长连接request response 类注册逻辑,由类扫描改成手动注册 (#9738)
* 修改request response 类加载逻辑,有类扫描改成手动注册

* 优化注册方式,直接SPI注册payload
2022-12-21 19:56:21 +08:00
nov.lzf
1322486849
Develop optimize controplugin 20221214 (#9715)
* 限流插件优化

* 反脆弱插件移除nacos-sys依赖

* 移除nacos-sys依赖
2022-12-16 13:18:44 +08:00
杨翊 SionYang
dfcdd391af
Add auth for some v2 api. (#9671) 2022-12-08 10:31:32 +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
李晓双 Li Xiao Shuang
0348014c17
[ISSUE #9490] Optimize datasource name configuration reading (#9491)
* Optimize data source name configuration reading

* Optimize data source name configuration reading

* Compatible with old and new datasource platform read

* Compatible with old and new datasource platform read

* Compatible with old and new datasource platform read

* Compatible with old and new datasource platform read

* fix unit test

* fix unit test
2022-11-08 09:22:33 +08:00
无处不在
21683957e5
[ISSUE #9415]update setExternalStorage logic,support more db check,add 8 count unit test (#9470)
* [impr]update setExternalStorage method logic,support more db check,add 8 count unit test method

* update comment desc
2022-11-07 17:17:52 +08:00
hth
5ea747b863
[ISSUE #8619] add CustomEnvironmentPlugin (#8619) (#9296)
* [ISSUE #8619] add CustomEnvironmentPlugin (#8619)

* feature issue #8619 .

* custom properties.

* reformat codes and author fix

* remove customEnvironment to nacos-core and Complete test

* add license

* pmd fix

* code optimization

* conflict fix
2022-11-04 15:24:25 +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
Daydreamer-ia
bb92da0661 Remove unused wait in GrpcClient and field in ClientAbilities, change ^ to != in MemeberUtil. 2022-10-25 14:18:17 +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
杨翊 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
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
杨翊 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
Yann
c191d7a238
fix jraft npe log (#9271) (#9272) 2022-10-10 11:46:49 +08:00
Daydreamer-ia
d42ce9bc8f Add test for sever abilities initializing in manager. 2022-09-28 15:38:20 +08:00
杨翊 SionYang
45165f7c06
[ISSUE#8650] Make cluster/report both receive and send metadata. (#9228)
* cluster/report api return self information.

* Update metadata when received report response.

* Add UT for handle report member info response.

* For checkstyle.
2022-09-28 14:43:14 +08:00
Daydreamer-ia
a159e1261c Add integration test. 2022-09-20 20:36:34 +08:00
Daydreamer-ia
677c50e2f6 Notify server ability by ServerRequest. 2022-09-20 16:22:15 +08:00
Daydreamer-ia
5ec1d1f8b5 Change the format of ability table key to string, less time for format conversion when saving. 2022-09-20 15:24:46 +08:00
Daydreamer-ia
5cbfc524a9 Client combine ability then return to server. 2022-09-19 21:44:22 +08:00
jiaoja
45f38b5aeb
[ISSUE #9154] Solve the nullcheck of value previously dereferenced. (#9157)
* [ISSUE #9154] Solve the nullcheck of value previously dereferenced.

* [ISSUE #9154] Remove unused import.
2022-09-19 09:45:00 +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
Daydreamer-ia
4cff58da13 Add capability table to RequestMeta. 2022-09-10 21:32:42 +08:00
Daydreamer-ia
8f14e63f0c Combine with current node abilities. 2022-09-10 20:20:09 +08:00
Daydreamer-ia
a8c3b847c0 Add the api to judge ability, add junit test. 2022-09-10 20:08:15 +08:00
Daydreamer-ia
2571bb6ca7 Combine junit test 2022-09-10 15:03:02 +08:00
Daydreamer-ia
12e447e690 Add the connection arg to ServerRequestHandler in order to get ability easily. 2022-09-10 14:46:30 +08:00
Daydreamer-ia
e3a3139c33 Save the ability table to Connection. 2022-09-10 13:53:48 +08:00
Daydreamer-ia
02bd4872ca Change the way to transport ability table. 2022-09-09 18:41:04 +08:00
Daydreamer-ia
89b450537e Add the response to setup request. 2022-09-08 18:23:35 +08:00
Daydreamer-ia
eedb84f2a1 Send the newest abilities to client. 2022-09-05 16:22:42 +08:00
Daydreamer-ia
eb6ea55fef load server abilities from ServerAbilities if config doesn't define 2022-09-04 17:11:26 +08:00
Daydreamer-ia
fd6938566f Add junit test 2022-09-04 16:50:25 +08:00
Daydreamer-ia
6b2d3b1f3a Return nothing if existed connection from other cluster node doesn't support ability table. 2022-09-04 16:31:45 +08:00
Daydreamer-ia
eada63e8d0 Fix checkstyle and support server ability manager load config. 2022-09-03 16:01:24 +08:00
Daydreamer-ia
4de709cc0a Supports server change ability by editing config. 2022-09-03 14:27:41 +08:00
Daydreamer-ia
ac2523ab7d Add the priority to AbilityControlManager. 2022-09-03 14:11:55 +08:00
Daydreamer-ia
182b821938 Remove the component listening to cluster ability, disable the cluster capability table when the connected server does not support capability negotiation. 2022-09-02 21:56:03 +08:00
DongYafei
5373513331
update NacosClusterControllerV2 (#9066) 2022-09-02 15:39:28 +08:00
Daydreamer-ia
41d278d6f1 Add junit test 2022-09-01 20:31:48 +08:00