From d6037f99c13320c79149eece793088be22abcc17 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Wed, 27 Nov 2024 13:25:55 -0500 Subject: [PATCH] Only set once Signed-off-by: Craig Perkins --- .../opensearch/security/configuration/DlsFlsValveImpl.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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);