Commit Graph

595 Commits

Author SHA1 Message Date
kanghailin
49f34868ff
Optimize ThreadPoolManager (#11206) 2023-10-13 10:31:25 +08:00
chenyiqin
a5c0a60a1a
Fix npe when setup ack response in GrpcClient (#11210)
* fix npe when setup ack response in GrpcClient

* server sync response, avoid blocking setup ack response sent to server.

* remove setup response from client to server, change way of server pushing abilities by sendNoACK

* add UT for negotiation timeout

* fix checkstyle

* fix PMD error

* private check logical into ReceiveAbilityContext.

* fix indent
2023-10-13 09:48:06 +08:00
阿魁
1c7b9b96e1
[ISSUE #10797]Enhance the registration logic. (#11228) 2023-10-09 09:59:27 +08:00
KomachiSion
3cfe5e82f2 Fix server push is intercepted by SetupRequestHandler problem. 2023-09-28 11:55:00 +08:00
KomachiSion
4522cbcccb For checkstyle. 2023-09-28 10:49:10 +08:00
Daydreamer-ia
cb70aaf3c7 refactor AbilityControlManager with multiple ability mode. 2023-09-25 19:24:44 +08:00
Daydreamer-ia
6bce3bda7b add AbilityPostProcessor param to know abilities init detail, sdk client, server or cluster client 2023-09-25 14:44:47 +08:00
Daydreamer-ia
41a3f13a66 remove HandlerMapping.java and ability change call back 2023-09-25 14:33:20 +08:00
Daydreamer-ia
c565a2bdd5 extern abilities spi processor, refactor AbilityKey. 2023-09-25 14:17:18 +08:00
Daydreamer-ia
e5f54badb3 remove connectionId in SetupAckRequest, expose timeout param for capability negotiation, add uncommitted file 2023-09-24 22:14:06 +08:00
Daydreamer-ia
fc8549dc8f Merge remote-tracking branch 'origin/develop' into asoc2022_issue#8458
# Conflicts:
#	client/src/test/java/com/alibaba/nacos/client/naming/remote/gprc/redo/NamingGrpcRedoServiceTest.java
#	common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java
2023-09-24 15:18:17 +08:00
贾璞
7b2f7aa92a
[ISSUE#11035](PR-2/4) add two string methods & avoid null pointer ... (#11065)
* [#11035] (PR-2/4) add two String methods...

* [ISSUE#10908] edit test case, add blank line

* [ISSUE#11035] restore a method
2023-09-14 09:42:03 +08:00
阿魁
5c8def0d25
[ISSUE #11072]Enhance unit tests related to trace events. (#11105) 2023-09-14 09:38:48 +08:00
阿魁
a170489667
Fix RPC_CLIENT_TLS_PROTOCOLS setting error. (#11109) 2023-09-14 09:37:38 +08:00
Guangdong Liu
279e488e03
[Refactor]Remove unnecessary judgment (#11019)
* remove unnecessary judgment

* remove unnecessary judgment
2023-09-06 17:10:09 +08:00
阿魁
02fcbb0915
[ISSUE #11057]Add update instance and update service trace event for naming. (#11069)
* [ISSUE #11057]Add update instance and update service trace event for naming.

* [ISSUE #11057]Add license.

* [ISSUE #11057]Remove unused imports.

* [ISSUE #11057]Improve the logic.

* [ISSUE #11057]Fix checkStyle.

* [ISSUE #11057]Perfect unit test.

* [ISSUE #11057]Improve the logic.

* [ISSUE #11057]Improve the logic.

* [ISSUE #11057]UpdateInstanceTraceEvent add metadata.

* [ISSUE #11057]UpdateServiceTraceEvent.java add metadata.
2023-09-06 17:01:16 +08:00
forachange
9f28ae55a2
Update StringUtils.java (#10936)
method startsWith, 当 ignoreCase 为 true 时,lowerCasePrefix 值不正确
2023-08-14 15:22:48 +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
阿魁
37d45ad8b6
Fix RpcClient retries.(#10952) (#10958) 2023-08-14 10:15:20 +08:00
阿魁
86cf2082a9
Fix exception code error.(#10925) (#10926) 2023-08-10 11:07:47 +08:00
Sunrisea
a76f0771e7
For #10734,fix the param check rule (#10858) 2023-07-28 09:33:07 +08:00
Sunrisea
65ad408d03
For #10734,fix the param check rule (#10826) 2023-07-25 09:33:44 +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
blake.qiu
156cd62261
fix(#10427): When the execution of handleServerRequest() encounters an exception, record the log and throw an exception, then quickly response to the server errResponse (#10770) 2023-07-13 11:11:05 +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
blake.qiu
9116aee82f
fix(#10717): com.alibaba.nacos.common.http.client.request.JdkHttpClientRequest.execute, when the body instanceof String, no longer call com.alibaba.nacos.common.utils.JacksonUtils.toJson to parse body. (#10718) 2023-07-02 00:02:57 +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
83ee4c8e2c
1. notify thread change to one thread to avoid potential ClassLoader switch exception (#10555)
2. optimize current notify ,add receiveNotifyChanged flag
3. add notify block log for over 60s
4. add notify error & block stack trace
5. fix shutdown client worker memory leak  of server list change subscriber
6. use multi thread for different  task id  for sync with server to speed up config sync.
7. fix exception when request with 0 or negative timeouts.
8. simply local snapshot path  when env name over 50 chars
9. add a random sleep in health check for avoid health check syntony.
2023-05-26 17:01:06 +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
Karson
6b0df825df
[Optimization] Code optimization for MapUtil (#10461)
* maputil enhancement

* optimization
2023-05-11 11:51:58 +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
杨翊 SionYang
b3b5236cd4
Develop synced from 2.2.2 (#10307)
* Fix dynamic change token to illegal value will use old token.

* Add description in pom for release.

* Upgrade to 2.2.2

* Upgrade to 2.3.0-SNAPSHOT
2023-04-11 17:34:06 +08:00
nov.lzf
c519922280
取消默认openssl (#10276)
* 取消默认openssl

* 连接上下文标签中添加tls.enable

* test fix

* checkstyle
2023-04-07 14:56:13 +08:00
varyuan
2dde125a51
clean code (#10180)
* clean code

* clean code

* clean code

* clean code
2023-03-29 14:25:22 +08:00
chenyiqin
e002cefb6e
Fix fs char (#10101)
* Add PathEncoder for OS to encode if dataId, ns, group contains illegal char for file system

* Add copyright

* Fix checkstyle

* Fix pmd

* fix PathEncoderManager as singleton

* fix ut

* fix checkstyle
2023-03-27 15:04:20 +08:00
nov.lzf
c39ba4a35c
ssl context reload spi (#10150) 2023-03-21 15:27:57 +08:00
云野
6bcae29cc5
add unit tests for AbstractObjectUtils. (#10138)
add unit tests for AbstractAssert.
add unit tests for GrpcUtils.
2023-03-21 13:48:21 +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
t8g
74b81be92c
fix:Utility classes should not have public constructors (#10019) 2023-03-06 09:39:43 +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
胡俊
579571ceb3
[ISSUE #9860] abstract the nacos logback configurator to solve the problem between different version (#9934)
* logback update

* update comment

* ident update

* comment update

* judge version

* remove logback-adapter
2023-02-22 11:20:46 +08:00
t8g
90bfe0af9e
Fixed some minor bugs in CollectionUtils.java (#9989)
* fix:CollectionUtils下for循环中的字符串拼接改用StringBuilder

* fix:The LinkedHashSet in CollectionUtils.java lacks a generic

* docs:a is used before a consonant; an is used before a vowel
2023-02-22 11:17:36 +08:00
ZhangShenao
815197cdf1
[ISSUE #9930] fix word spelling error in com.alibaba.nacos.common.http.AbstractHttpClientFactory#ASYNC_IO_REACTOR_NAME (#9931)
* code optimization for `ConfigChangeHandler`

* [ISSUE #9930] fix word spelling error in com.alibaba.nacos.common.http.AbstractHttpClientFactory#ASYNC_IO_REACTOR_NAME
2023-02-13 09:45:59 +08:00
xzxiaoshan
41f03fea0f
[ISSUE#9730] 对多数据源插件代码进行调整(向前兼容) (#9784)
* Upgrade to 2.2.1-RC (#9741)

* 补充处理所有 tenantId

* 补充处理 tenantId

* 处理tenantid,内部类引用的变量不能被修改,换个变量名

* 新增支持:nacos 默认的 tenant/namespaceId 为空字符串,自 nacos 2.2.0 版本起开始支持多数据源插件,为空的 ID 会在 oracle 数据库适配中出现问题 ( where tenantid = '' ),本次修改对以往程序不产生影响。

* 固定填充的ID为public,完全自定义没有太大意义,目的是在保证默认id不为空,可选填充,不配置默认照旧

* fix bug

* 将通用的SQL提取到Mapper接口中,这样能很大的降低不同数据库需要重写的SQL的量,同时避免了大量的重复代码问题。

* 将原来sql中固定写死的 tenant_id = ''  修改为 tenant_id =  NamespaceUtil.getNamespaceDefaultId() 。暂时没深究为什么不用问号动参而是固定写死。

* 方法提取到 mapper 接口中,顺便解决了多余 paramList 定义的(虽然这个方法好像已经弃用)

* 方法迁移到接口默认实现中

* 恢复 publci id 默认值为空值 "",等以后决策好使用默认值为 "public" 时,再设置 NAMESPACE_PUBLIC_ID_DEFAULT="public" 即可。

* 回滚 Controller 层对 tenant_id 的处理,另起PR讨论和修改。

* code style

* 变量名称和注释未通过 checkStyle 检查,按规范调整。

* nacos check style 修改,无代码变动

* fix code

* fix checkstyle

* fix checkstyle 去除多余的 return

* fix pmd

* fix test unit bug

* 因为将sql提取到 mapper 接口中,一些不影响sql语句运行的sql,有空格等差异,出现了test用例差异问题,逐个处理。比如(where a =? 和 where a= ?)

Co-authored-by: 杨翊 SionYang <xiweng.yy@alibaba-inc.com>
2023-01-16 16:14:29 +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
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