clebertsuconic commented on a change in pull request #3089: ARTEMIS-2720
Optimize HierarchicalObjectRepository
URL: https://github.com/apache/activemq-artemis/pull/3089#discussion_r410448783
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/HierarchicalObjectRepository.java
##########
@@ -172,7 +172,12 @@ private void addMatch(final String match, final T value,
final boolean immutable
lock.writeLock().lock();
try {
String modifiedMatch = matchModifier.modify(match);
- clearCache();
+ // an exact match (i.e. one without wildcards) won't impact any other
matches so no need to clear the cache
+ if (usesWildcards(modifiedMatch)) {
Review comment:
This is tempting, but I don't think this is correct.
you may be removing an entry that was part of another wildcard. The cache
has to be cleared on the other side as well.
I will add a test that would be broken by your change here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services