diff --git a/src/main/java/org/opensearch/security/configuration/DlsFlsValveImpl.java b/src/main/java/org/opensearch/security/configuration/DlsFlsValveImpl.java index 3bac72890b..1afb0f36b8 100644 --- a/src/main/java/org/opensearch/security/configuration/DlsFlsValveImpl.java +++ b/src/main/java/org/opensearch/security/configuration/DlsFlsValveImpl.java @@ -683,7 +683,7 @@ static Mode get(Settings settings) { public void updateConfiguration(SecurityDynamicConfiguration rolesConfiguration) { try { if (rolesConfiguration != null) { - DlsFlsProcessedConfig oldConfig = this.dlsFlsProcessedConfig.getAndSet( + this.dlsFlsProcessedConfig.set( new DlsFlsProcessedConfig( DynamicConfigFactory.addStatics(rolesConfiguration.clone()), clusterService.state().metadata().getIndicesLookup(), @@ -692,10 +692,6 @@ public void updateConfiguration(SecurityDynamicConfiguration rolesConfig fieldMaskingConfig ) ); - - if (oldConfig != null) { - oldConfig.shutdown(); - } } } catch (Exception e) { log.error("Error while updating DLS/FLS configuration with {}", rolesConfiguration, e);