]
Brian Stansberry commented on WFLY-12970:
-----------------------------------------
When the JIRA for the smallryte-metrics upgrade gets filed please add an
"Incorporates" JIRA link to this one. That will help ensure this gets cleaned
up. Thanks!
SmallRye Metrics - MetricsRegistryImpl - removal of entry from map
which is currently iterated
----------------------------------------------------------------------------------------------
Key: WFLY-12970
URL:
https://issues.redhat.com/browse/WFLY-12970
Project: WildFly
Issue Type: Bug
Components: MP Metrics
Reporter: Rostislav Svoboda
Assignee: Jason Lee
Priority: Major
SmallRye Metrics - MetricsRegistryImpl - removal of entry from map which is currently
iterated
https://github.com/smallrye/smallrye-metrics/blob/master/implementation/s...
Method {{removeMatching}} is iterating over {{metricMap}}. If there is a match {{remove}}
method is called. This method removes entry from {{metricMap}} and from {{metadataMap}}.
I don't like the fact that the entry is removed from the map by external method while
the map is currently iterated by the {{removeMatching}} method.
I think
https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html#remove-- should
be called in {{removeMatching}} for {{metricMap}} entry + invocation of
metadataMap.remove(entry.getKey()) + log mesasge;