Skip to content

Commit

Permalink
Only set once
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Nov 27, 2024
1 parent 4769144 commit d6037f9
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ static Mode get(Settings settings) {
public void updateConfiguration(SecurityDynamicConfiguration<RoleV7> rolesConfiguration) {
try {
if (rolesConfiguration != null) {
DlsFlsProcessedConfig oldConfig = this.dlsFlsProcessedConfig.getAndSet(
this.dlsFlsProcessedConfig.set(
new DlsFlsProcessedConfig(
DynamicConfigFactory.addStatics(rolesConfiguration.clone()),
clusterService.state().metadata().getIndicesLookup(),
Expand All @@ -692,10 +692,6 @@ public void updateConfiguration(SecurityDynamicConfiguration<RoleV7> rolesConfig
fieldMaskingConfig
)
);

if (oldConfig != null) {
oldConfig.shutdown();
}
}
} catch (Exception e) {
log.error("Error while updating DLS/FLS configuration with {}", rolesConfiguration, e);
Expand Down

0 comments on commit d6037f9

Please sign in to comment.