Skip to content

Commit

Permalink
Keep oldConfig
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Dec 3, 2024
1 parent e133b39 commit d24ca83
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ static Mode get(Settings settings) {
public void updateConfiguration(SecurityDynamicConfiguration<RoleV7> rolesConfiguration) {
try {
if (rolesConfiguration != null) {
this.dlsFlsProcessedConfig.set(
DlsFlsProcessedConfig oldConfig = this.dlsFlsProcessedConfig.getAndSet(
new DlsFlsProcessedConfig(
DynamicConfigFactory.addStatics(rolesConfiguration.clone()),
clusterService.state().metadata().getIndicesLookup(),
Expand All @@ -689,6 +689,10 @@ 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 d24ca83

Please sign in to comment.