Fixed part of the dynamic configuration of ConfigurationDiscoveryService that does not take effect under certain circumstances. (#6975)
This commit is contained in:
parent
8c23752c6d
commit
97c42d2f86
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue