Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to 2.1.2 #9335

Merged
merged 85 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3586ad6
[ISSUE#8910] bug fix calcu ipCount (#8911)
chenhao26-nineteen Aug 10, 2022
65244c5
judge endpoint (#8933)
hujun-w-2 Aug 11, 2022
493b99b
[ISSUE #8925] fix that the value of hasQueryString is always false (#…
onewe Aug 11, 2022
0c61c5d
[ISSUES#8905]simplify some code (#8908)
hitcp Aug 11, 2022
8cede1c
refactor: 💡 update console-ui theme (#8951)
heimanba Aug 11, 2022
474b25d
Update IoUtils.java (#8948)
hitcp Aug 12, 2022
21b624e
[ISSUE #8931] Fix bug :BatchInstanceData cannot Serializable question…
wuchubuzai2018 Aug 12, 2022
8f8a1f3
[ISSUE #8925] fix that the replaceAll operation is invalid (#8929)
onewe Aug 12, 2022
b91abb8
fix #8947. (#8959)
YunWZ Aug 12, 2022
861e8c5
judge endpoint
hujun-w-2 Aug 12, 2022
faa69f4
Merge pull request #8962 from hujun-w-2/fix_address_bug2
chuntaojun Aug 12, 2022
b9609b3
add some junit test (#8966)
chenhao26-nineteen Aug 15, 2022
8c43096
optimize: internationalization of product description content on land…
xiaochangbai Aug 15, 2022
ec134a3
Improve code specifications. (#8965)
shiherua Aug 17, 2022
db72e4f
fix LookupFactoryTest ut / ci (#8985)
chenhao26-nineteen Aug 17, 2022
87d9efd
add some auth plugin test (#8988)
chenhao26-nineteen Aug 18, 2022
bdf9d04
remove namespaceShowName uniqueness check (#8989)
chenhao26-nineteen Aug 18, 2022
3839cdc
add unit test for ReflectUtils (#8999)
karsonto Aug 22, 2022
3f75b3a
[ISSUE #8993]Close input stream and output stream by try with resourc…
hitcp Aug 22, 2022
3c8c6a7
add some utils UT (#9006)
chenhao26-nineteen Aug 22, 2022
f1c95a8
Fix grpc push data not filter by cluster. (#9019)
KomachiSion Aug 24, 2022
cb3c78b
[#344] rename initialization sql files (#8969)
yjqg6666 Aug 25, 2022
0ac96e1
[ISSUE #9014] performance optimization--refacte TpsMonitorPoint (#9021)
YunWZ Aug 26, 2022
d123703
Fix spelling mistakes. (#9026)
stone-98 Aug 29, 2022
9819820
[ISSUE #9013] enhance grpc client (#9017)
karsonto Aug 29, 2022
aba8819
Fix ServerListMgr is not shutdown. (#9048)
wuwen5 Aug 30, 2022
c505a3f
set server.error.include-message to ALWAYS (#9045)
onewe Aug 30, 2022
44538d1
[ISSUE #8934] add header back after convert request to jsonBytes (#8935)
MajorHe1 Aug 30, 2022
40651f6
[ISSUE #9023] fix corner case config dataId 'cipher-' that cannot cre…
HotSince91 Aug 31, 2022
30794c4
fix unsubscribe bug (#9062)
liqipeng Sep 1, 2022
0aa695e
Add configurable for GrpcClient health check retry times (#9056)
karsonto Sep 2, 2022
6552aae
Fix spelling mistakes. (#9088)
stone-98 Sep 5, 2022
cdb1144
[ISSUE #7459] add eBook link (#9076)
rookie-ricardo Sep 6, 2022
b8bd1cb
Fix the actual number of health check retries less than the set one. …
stone-98 Sep 6, 2022
b36e6a5
[ISSUE #9013] Enhance Rpc config related to one RpcClientConfig (#9093)
karsonto Sep 7, 2022
fb71b4c
Refactor DefaultClientConfig for readability.
KomachiSion Sep 7, 2022
3d7bda8
Rename DefaultClientConfig > DefaultGrpcClientConfig
KomachiSion Sep 7, 2022
1e9b18c
only load grpc config from system one time.
KomachiSion Sep 7, 2022
b7f25e0
For checkstyle.
KomachiSion Sep 7, 2022
6d48459
Merge pull request #9108 from KomachiSion/develop-issue#9013
MajorHe1 Sep 7, 2022
a9af1bf
Fix spelling mistakes. (#9097)
stone-98 Sep 7, 2022
0cf9c24
remove redundant code (#9089)
lphx Sep 7, 2022
a090581
[fix]修复数据源连接DataSource中动态的ConnectionTimeout属性被覆盖问题 (#9115)
wuchubuzai2018 Sep 9, 2022
a89a46e
[ISSUE #9135] Remove redundant nullcheck code. (#9137)
jjastan Sep 15, 2022
f15b41b
fix naming example running NPE. (#9131)
karsonto Sep 15, 2022
0fdfd19
For #9106 Remove redundant judgment of WebUtils (#9107)
hoErYu Sep 15, 2022
419530d
Improving code specifications (#9165)
Roger3581321 Sep 18, 2022
45f38b5
[ISSUE #9154] Solve the nullcheck of value previously dereferenced. (…
jjastan Sep 19, 2022
8d75c28
resolve issue #9175 add ldap filter config
karsonto Sep 20, 2022
f27113b
add some unit test
karsonto Sep 20, 2022
091f530
Merge pull request #9178 from karsonto/develop-issue#9175
onewe Sep 20, 2022
e2468a4
[ISSUE #9172] Solve wrong use of GroupKey2 in GroupKeyTest. (#9173)
jjastan Sep 21, 2022
b37d100
upgrade org.yaml.snakeyaml version from 1.30 to 1.32 (#9179)
karsonto Sep 21, 2022
6278e7e
[ISSUE #8622] 移除 environment 概念 (#8991)
onewe Sep 22, 2022
a2b997f
Fix print logs for NamingTraceEvent.
KomachiSion Sep 22, 2022
9a474a0
Fix wrong and duplicate mysql connection configuration. (#9208)
stone-98 Sep 26, 2022
526c085
Feature #8941 Support Fuzzy Query in Authority Control--for api chang…
zhouchunhai Sep 26, 2022
1d8e5d9
Feature #8941 Support Fuzzy Query in Authority Control--for ui change…
zhouchunhai Sep 26, 2022
96f135a
GitHub Workflows security hardening (#9207)
sashashura Sep 26, 2022
2d84c0a
For #8611, Close old datasource connection. (#9212)
KomachiSion Sep 26, 2022
04fe7ea
Support client hash revision for DISTRO (#9214)
pixystone Sep 28, 2022
45165f7
[ISSUE#8650] Make cluster/report both receive and send metadata. (#9228)
KomachiSion Sep 28, 2022
71d7d36
[ISSUE #9227] fix subscriber scopeMatches (#9233)
ruansheng8 Sep 28, 2022
af22d35
[ISSUE #9230] Fix missing dependency between event publisher and subs…
pixystone Sep 29, 2022
f272c36
[ISSUE#9210] ConnectionBasedClient support add revision (#9239)
KomachiSion Sep 29, 2022
5396858
修复Grpc反序列化不完整 (#9252)
karsonto Oct 1, 2022
bc180f0
Fix a spelling mistake (#9258)
Roger3581321 Oct 10, 2022
e4510d6
Bump protobuf-java from 3.16.1 to 3.16.3 (#9259)
dependabot[bot] Oct 10, 2022
4c8130c
[ISSUE #6112]Unified derby-data variables (#9260)
The-Gamer-01 Oct 10, 2022
9c771cf
[ISSUE #9277] publisherIndexes clean the service key when no instance…
pixystone Oct 10, 2022
c191d7a
fix jraft npe log (#9271) (#9272)
Oct 10, 2022
c3b38a0
remove redundant judgment (#9284)
CLFutureX Oct 10, 2022
a78ee54
[ISSUE #6876] Concurrent instance deregiste NullPointerException (#9287)
karsonto Oct 10, 2022
a1b7054
build pure nacos-client when release.
KomachiSion Oct 10, 2022
5647101
Generate the serialVersionUID by IDEA (#9291)
Roger3581321 Oct 11, 2022
3ca75cd
fix bug #9263, lost page condition in configuration management page. …
zhouchunhai Oct 11, 2022
83e3e50
[impr]update Generate serialVersionUID Value to idea random (#9297)
wuchubuzai2018 Oct 11, 2022
1a1ef02
Merge pull request #9293 from KomachiSion/develop-issue#9091
MajorHe1 Oct 11, 2022
8aa2e0a
[ISSUE #9305] fix bug in ClientWorker.resourceBuild (#9306)
MajorHe1 Oct 12, 2022
c4d7c33
fix cache removed when listeneradd delay (#9311)
shiyiyue1102 Oct 12, 2022
2051855
Update Generate serialVersionUID Value to idea random (#9304)
wuchubuzai2018 Oct 12, 2022
0fdda8c
[ISSUE#7929] minijar pom update ,to reduce nacos-client jar size (#9…
shiyiyue1102 Oct 12, 2022
ee3ae00
Fix #9269, RpcClient support parse ipv6 address. (#9312)
KomachiSion Oct 13, 2022
0bfd752
Add switch for naming async query. (#9325)
KomachiSion Oct 14, 2022
0834641
[ISSUE#9323]1.x http接口服务名校验问题 (#9324)
hujun-w-2 Oct 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
branches: [ develop, v1.x-develop ]

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
unix:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
branches: [ develop, v1.x-develop ]

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
unix:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@

## 0.2.1-release(Sept 28, 2018)

* FIx deregister last instance failed error.
* Fix deregister last instance failed error.
* Fix url pattern error.
* Fully integrate with and seamlessly support Spring framework, Spring Boot and Spring Cloud
* Separate nacos-api from nacos client implementation
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ For more details, see [quick-start.](https://nacos.io/en-us/docs/quick-start.htm

You can view the full documentation from the [Nacos website](https://nacos.io/en-us/docs/what-is-nacos.html).

You can also read this online eBook from the [NACOS ARCHITECTURE & PRINCIPLES](https://www.yuque.com/nacos/ebook/kbyo6n).

All the latest and long-term notice can also be found here from [Github notice issue](https://github.com/alibaba/nacos/labels/notice).

## Contributing
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/com/alibaba/nacos/api/PropertyKeyConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public class PropertyKeyConst {

public static final String NAMING_PUSH_EMPTY_PROTECTION = "namingPushEmptyProtection";

public static final String NAMING_ASYNC_QUERY_SUBSCRIBE_SERVICE = "namingAsyncQuerySubscribeService";

public static final String PUSH_RECEIVER_UDP_PORT = "push.receiver.udp.port";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,18 @@

package com.alibaba.nacos.api.naming.remote.response;

import com.alibaba.nacos.api.remote.response.Response;

/**
* batch instance response.
*
* @author <a href="mailto:[email protected]">chenhao26</a>
*/
public class BatchInstanceResponse extends Response {

private String type;
public class BatchInstanceResponse extends InstanceResponse {

public BatchInstanceResponse() {
super();
}

public BatchInstanceResponse(String type) {
this.type = type;
}

public void setType(String type) {
this.type = type;
super(type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ public void setType(String type) {
this.type = type;
}

public String getType() {
return type;
}
}
166 changes: 134 additions & 32 deletions client/pom.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ public void shutdown() throws NacosException {
String className = this.getClass().getName();
LOGGER.info("{} do shutdown begin", className);
ConfigHttpClientManager.getInstance().shutdown();
serverListMgr.shutdown();
LOGGER.info("{} do shutdown stop", className);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public class CacheData {
*/
private volatile boolean isSyncWithServer = false;

/**
* if is cache data is discard,need to remove.
*/
private volatile boolean isDiscard = false;

private String type;

public boolean isInitializing() {
Expand Down Expand Up @@ -402,6 +407,14 @@ public void setSyncWithServer(boolean syncWithServer) {
isSyncWithServer = syncWithServer;
}

public boolean isDiscard() {
return isDiscard;
}

public void setDiscard(boolean discard) {
isDiscard = discard;
}

public CacheData(ConfigFilterChainManager configFilterChainManager, String name, String dataId, String group) {
this(configFilterChainManager, name, dataId, group, TenantUtil.getUserTenantForAcm());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ public class ClientWorker implements Closeable {
private int taskPenaltyTime;

private boolean enableRemoteSyncConfig = false;

private static final int MIN_THREAD_NUM = 2;

private static final int THREAD_MULTIPLE = 1;

/**
* Add listeners for data.
*
Expand All @@ -146,6 +146,7 @@ public void addListeners(String dataId, String group, List<? extends Listener> l
for (Listener listener : listeners) {
cache.addListener(listener);
}
cache.setDiscard(false);
cache.setSyncWithServer(false);
agent.notifyListenConfig();

Expand All @@ -169,6 +170,7 @@ public void addTenantListeners(String dataId, String group, List<? extends Liste
for (Listener listener : listeners) {
cache.addListener(listener);
}
cache.setDiscard(false);
cache.setSyncWithServer(false);
agent.notifyListenConfig();
}
Expand Down Expand Up @@ -196,6 +198,7 @@ public void addTenantListenersWithContent(String dataId, String group, String co
for (Listener listener : listeners) {
cache.addListener(listener);
}
cache.setDiscard(false);
cache.setSyncWithServer(false);
agent.notifyListenConfig();
}
Expand All @@ -217,6 +220,7 @@ public void removeListener(String dataId, String group, Listener listener) {
cache.removeListener(listener);
if (cache.getListeners().isEmpty()) {
cache.setSyncWithServer(false);
cache.setDiscard(true);
agent.removeCache(dataId, group);
}
}
Expand All @@ -240,6 +244,7 @@ public void removeTenantListener(String dataId, String group, Listener listener)
cache.removeListener(listener);
if (cache.getListeners().isEmpty()) {
cache.setSyncWithServer(false);
cache.setDiscard(true);
agent.removeCache(dataId, group);
}
}
Expand Down Expand Up @@ -425,8 +430,8 @@ public ClientWorker(final ConfigFilterChainManager configFilterChainManager, Ser
}

private void refreshContentAndCheck(String groupKey, boolean notify) {
if (cacheMap.get() != null && cacheMap.get().containsKey(groupKey)) {
CacheData cache = cacheMap.get().get(groupKey);
CacheData cache = cacheMap.get().get(groupKey);
if (cache != null) {
refreshContentAndCheck(cache, notify);
}
}
Expand Down Expand Up @@ -696,7 +701,7 @@ public void startInternal() {
continue;
}
executeConfigListen();
} catch (Exception e) {
} catch (Throwable e) {
LOGGER.error("[ rpc listen execute ] [rpc listen] exception", e);
}
}
Expand Down Expand Up @@ -733,7 +738,7 @@ public void executeConfigListen() {
}
}

if (!CollectionUtils.isEmpty(cache.getListeners())) {
if (!cache.isDiscard()) {
//get listen config
if (!cache.isUseLocalConfigInfo()) {
List<CacheData> cacheDatas = listenCachesMap.get(String.valueOf(cache.getTaskId()));
Expand All @@ -744,7 +749,7 @@ public void executeConfigListen() {
cacheDatas.add(cache);

}
} else if (CollectionUtils.isEmpty(cache.getListeners())) {
} else if (cache.isDiscard()) {

if (!cache.isUseLocalConfigInfo()) {
List<CacheData> cacheDatas = removeListenCachesMap.get(String.valueOf(cache.getTaskId()));
Expand Down Expand Up @@ -779,7 +784,7 @@ public void executeConfigListen() {
RpcClient rpcClient = ensureRpcClient(taskId);
ConfigChangeBatchListenResponse configChangeBatchListenResponse = (ConfigChangeBatchListenResponse) requestProxy(
rpcClient, configChangeListenRequest);
if (configChangeBatchListenResponse != null && configChangeBatchListenResponse.isSuccess()) {
if (configChangeBatchListenResponse.isSuccess()) {

Set<String> changeKeys = new HashSet<>();
//handle changed keys,notify listener
Expand Down Expand Up @@ -807,8 +812,8 @@ public void executeConfigListen() {
if (!cacheData.getListeners().isEmpty()) {

Long previousTimesStamp = timestampMap.get(groupKey);
if (previousTimesStamp != null && !cacheData.getLastModifiedTs().compareAndSet(previousTimesStamp,
System.currentTimeMillis())) {
if (previousTimesStamp != null && !cacheData.getLastModifiedTs()
.compareAndSet(previousTimesStamp, System.currentTimeMillis())) {
continue;
}
cacheData.setSyncWithServer(true);
Expand Down Expand Up @@ -844,7 +849,7 @@ public void executeConfigListen() {
if (removeSuccess) {
for (CacheData cacheData : removeListenCaches) {
synchronized (cacheData) {
if (cacheData.getListeners().isEmpty()) {
if (cacheData.isDiscard()) {
ClientWorker.this
.removeCache(cacheData.dataId, cacheData.group, cacheData.tenant);
}
Expand Down Expand Up @@ -979,8 +984,8 @@ public ConfigResponse queryConfig(String dataId, String group, String tenant, lo
LOGGER.error("[{}] [sub-server-error] dataId={}, group={}, tenant={}, code={}", this.getName(), dataId,
group, tenant, response);
throw new NacosException(response.getErrorCode(),
"http error, code=" + response.getErrorCode() + ",msg=" + response.getMessage() + ",dataId=" + dataId + ",group=" + group
+ ",tenant=" + tenant);
"http error, code=" + response.getErrorCode() + ",msg=" + response.getMessage() + ",dataId="
+ dataId + ",group=" + group + ",tenant=" + tenant);

}
}
Expand Down Expand Up @@ -1012,20 +1017,20 @@ private RequestResource resourceBuild(Request request) {
if (request instanceof ConfigQueryRequest) {
String tenant = ((ConfigQueryRequest) request).getTenant();
String group = ((ConfigQueryRequest) request).getGroup();
String dataId = ((ConfigQueryRequest) request).getGroup();
String dataId = ((ConfigQueryRequest) request).getDataId();
return buildResource(tenant, group, dataId);
}
if (request instanceof ConfigPublishRequest) {
String tenant = ((ConfigPublishRequest) request).getTenant();
String group = ((ConfigPublishRequest) request).getGroup();
String dataId = ((ConfigPublishRequest) request).getGroup();
String dataId = ((ConfigPublishRequest) request).getDataId();
return buildResource(tenant, group, dataId);
}

if (request instanceof ConfigRemoveRequest) {
String tenant = ((ConfigRemoveRequest) request).getTenant();
String group = ((ConfigRemoveRequest) request).getGroup();
String dataId = ((ConfigRemoveRequest) request).getGroup();
String dataId = ((ConfigRemoveRequest) request).getDataId();
return buildResource(tenant, group, dataId);
}
return RequestResource.configBuilder().build();
Expand Down Expand Up @@ -1059,7 +1064,7 @@ public boolean publishConfig(String dataId, String group, String tenant, String
}
} catch (Exception e) {
LOGGER.warn("[{}] [publish-single] error, dataId={}, group={}, tenant={}, code={}, msg={}",
this.getName(), dataId, group, tenant, "unkonw", e.getMessage());
this.getName(), dataId, group, tenant, "unknown", e.getMessage());
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,24 +223,24 @@ public ServerListManager(Properties properties) throws NacosException {
}

private String initServerName(Properties properties) {
String serverName = "";
String serverName;
//1.user define server name.
if (properties != null && properties.containsKey(PropertyKeyConst.SERVER_NAME)) {
serverName = properties.get(PropertyKeyConst.SERVER_NAME).toString();
} else {
// if fix url,use fix url join string.
if (isFixed) {
serverName = FIXED_NAME + "-" + (StringUtils.isNotBlank(namespace) ? (StringUtils.trim(namespace) + "-")
: "") + getFixedNameSuffix(serverUrls.toArray(new String[serverUrls.size()]));
: "") + getFixedNameSuffix(serverUrls.toArray(new String[0]));
} else {
//if use endpoint , use endpoint ,content path ,serverlist name
serverName = CUSTOM_NAME + "-" + String
.join("_", endpoint, String.valueOf(endpointPort), contentPath, serverListName) + (
StringUtils.isNotBlank(namespace) ? ("_" + StringUtils.trim(namespace)) : "");
}
}
serverName.replaceAll("\\/", "_");
serverName.replaceAll("\\:", "_");
serverName = serverName.replaceAll("\\/", "_");
serverName = serverName.replaceAll("\\:", "_");

return serverName;
}
Expand All @@ -254,8 +254,8 @@ private void initAddressServerUrl(Properties properties) {
ContextPathUtil.normalizeContextPath(this.contentPath), this.serverListName));
boolean hasQueryString = false;
if (StringUtils.isNotBlank(namespace)) {
addressServerUrlTem.append("?namespace=" + namespace);
hasQueryString = false;
addressServerUrlTem.append("?namespace=").append(namespace);
hasQueryString = true;
}
if (properties != null && properties.containsKey(PropertyKeyConst.ENDPOINT_QUERY_PARAMS)) {
addressServerUrlTem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static class SysEnv {

public static final String JM_SNAPSHOT_PATH = "JM.SNAPSHOT.PATH";

public static final String NACOS_ENVS_SEARCH = "nacos.envs.search";
public static final String NACOS_ENV_FIRST = "nacos.env.first";

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.alibaba.nacos.client.env;

import java.util.Properties;

abstract class AbstractPropertySource {

/**
Expand All @@ -31,4 +33,17 @@ abstract class AbstractPropertySource {
*/
abstract String getProperty(String key);

/**
* Tests if the specified object is a key in this propertySource.
* @param key key – possible key
* @return true if and only if the specified object is a key in this propertySource, false otherwise.
*/
abstract boolean containsKey(String key);

/**
* to properties.
* @return properties
*/
abstract Properties asProperties();

}
Loading