未验证 提交 97c42d2f 编写于 作者: Z zifeihan 提交者: GitHub

Fixed part of the dynamic configuration of ConfigurationDiscoveryService that...

Fixed part of the dynamic configuration of ConfigurationDiscoveryService that does not take effect under certain circumstances. (#6975)
上级 8c23752c
......@@ -28,6 +28,7 @@ Release Notes.
* Fix NPE when thrift field is nested in plugin `thrift`
* Fix possible NullPointerException in agent's ES plugin.
* Fix the conversion problem of float type in ConfigInitializer.
* Fixed part of the dynamic configuration of ConfigurationDiscoveryService that does not take effect under certain circumstances.
#### OAP-Backend
* BugFix: filter invalid Envoy access logs whose socket address is empty.
......
......@@ -62,6 +62,8 @@ public class ConfigurationDiscoveryService implements BootService, GRPCChannelLi
private String uuid;
private final Register register = new Register();
private volatile int lastRegisterWatcherSize;
private volatile ScheduledFuture<?> getDynamicConfigurationFuture;
private volatile GRPCChannelStatus status = GRPCChannelStatus.DISCONNECT;
private volatile ConfigurationDiscoveryServiceGrpc.ConfigurationDiscoveryServiceBlockingStub configurationDiscoveryServiceBlockingStub;
......@@ -206,6 +208,15 @@ public class ConfigurationDiscoveryService implements BootService, GRPCChannelLi
try {
ConfigurationSyncRequest.Builder builder = ConfigurationSyncRequest.newBuilder();
builder.setService(Config.Agent.SERVICE_NAME);
// Some plugin will register watcher later.
final int size = register.keys().size();
if (lastRegisterWatcherSize != size) {
// reset uuid, avoid the same uuid causing the configuration not to be updated.
uuid = null;
lastRegisterWatcherSize = size;
}
if (null != uuid) {
builder.setUuid(uuid);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册