Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-12970

SmallRye Metrics - MetricsRegistryImpl - removal of entry from map which is currently iterated

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: MP Metrics
    • Labels:
      None

      Description

      SmallRye Metrics - MetricsRegistryImpl - removal of entry from map which is currently iterated

      https://github.com/smallrye/smallrye-metrics/blob/master/implementation/src/main/java/io/smallrye/metrics/MetricsRegistryImpl.java#L266

      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;

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jmesnil Jeff Mesnil
                Reporter:
                rsvoboda Rostislav Svoboda
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: