• Andy Wilkinson's avatar
    Improve thread-safety of MetricRegistryMetricReader · 4487823f
    Andy Wilkinson authored
    ee567fa8 boldy claimed that it had made MetricRegistryMetricReader
    thread-safe. It had not. This commit should actually make it thread
    safe. I hope.
    
    One notable improvement is that MetricRegistryMetricReader.findAll()
    will no longer contain null values if a metric is removed on another
    thread during iteration.
    
    names is now a ConcurrentHashMap to allow it to be safely read and
    written without holding a lock.
    
    reverse is a LinkedMultiValueMap  which is not thread-safe. This could
    lead to values being lost when concurrent add calls were made. Access
    to reverse is now protected by synchronizing on an internal monitor
    object.
    
    Calls to containsKey(key) followed by get(key) have been reworked to
    only call get(key), this avoids the possibility of the key being
    removed after the contains check but before the get.
    
    Closes gh-2590
    4487823f
Name
Last commit
Last update
docs Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-deployment-tests Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-tools Loading commit data...
spring-boot-versions Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
pom.xml Loading commit data...