[ 
https://issues.apache.org/jira/browse/ARTEMIS-5871?focusedWorklogId=1003467&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1003467
 ]

ASF GitHub Bot logged work on ARTEMIS-5871:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Feb/26 12:39
            Start Date: 04/Feb/26 12:39
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on code in PR #6205:
URL: https://github.com/apache/artemis/pull/6205#discussion_r2763806144


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java:
##########
@@ -1040,6 +1040,20 @@ public void addJaasConfig(JaasAppConfiguration config) {
       jaasConfigs.put(config.getName(), config);
    }
 
+   @Override
+   public Configuration setJaasConfigs(Map<String, JaasAppConfiguration> 
configs) {
+      jaasConfigs.putAll(configs);
+      // prune removed entries after update to retain existing entries, this 
is live config referenced by jaas
+      // see 
org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.getAppConfigurationEntry
+      for (Iterator<String> iterator = jaasConfigs.keySet().iterator(); 
iterator.hasNext();) {
+         String entry = iterator.next();
+         if (!configs.containsKey(entry)) {
+            iterator.remove();
+         }
+      }

Review Comment:
   I agree with Tim that this method seems questionable as a setter. 
   
   That said, depending on what else is using/modifying it (which seems like 
should not be allowed concurrently..maybe synchronized method?), something like 
`jaasConfigs.keySet().retainAll(configs);` would seem equivalent to this.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1003467)
    Time Spent: 2h 10m  (was: 2h)

> reload of broker properties config should be restricted to confined to 
> re-loadable components
> ---------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5871
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5871
>             Project: Artemis
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.50.0
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> currently on reload config, broker properties are applied to the current 
> broker config in error. 
> This means that the absence of a value is not reflected in the config update, 
> simply removing the properties does not result in a removed component or 
> configuration entry.
> This is not consistent with the xml reload but also means for properties only 
> config, there needs to be an explicit remove key=- value. which then needs to 
> be removed. 
> If config reload of properties are confined to a new config that is then 
> compared in the normal way with the component reload logic, the properties 
> can be the source of truth.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to