Skip to content

Commit c38a19c

Browse files
authored
fix the conditions for resetting uuid in dynamic configuration (#588)
1 parent 6baa4a7 commit c38a19c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ Callable {
149149
* Upgrade guava to 32.0.1
150150
* Fix issue with duplicate enhancement by ThreadPoolExecutor
151151
* Add plugin to support for RESTeasy 6.x.
152+
* Fix the conditions for resetting uuid, avoid the same uuid causing the configuration not to be updated.
152153

153154
#### Documentation
154155

apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/dynamic/ConfigurationDiscoveryService.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private void getAgentDynamicConfig() {
219219
builder.setService(Config.Agent.SERVICE_NAME);
220220

221221
// Some plugin will register watcher later.
222-
final int size = register.keys().size();
222+
final int size = register.getRegisterWatcherSize();
223223
if (lastRegisterWatcherSize != size) {
224224
// reset uuid, avoid the same uuid causing the configuration not to be updated.
225225
uuid = null;
@@ -273,6 +273,12 @@ public Set<String> keys() {
273273
return register.keySet();
274274
}
275275

276+
public int getRegisterWatcherSize() {
277+
return register.values().stream()
278+
.mapToInt(List::size)
279+
.sum();
280+
}
281+
276282
@Override
277283
public String toString() {
278284
ArrayList<String> registerTableDescription = new ArrayList<>(register.size());

0 commit comments

Comments
 (0)