• Andy Wilkinson's avatar
    Make sure the HealthMvcEndpoint is thread-safe · 7a04708c
    Andy Wilkinson authored
    Previously, HealthMvcEndpoint stored the cached Health and its last
    access time in two separate fields. Neither field was volatile and
    no synchronization was used. This meant that there were potential
    visibility problems. In a possible worst case scenario one field may
    see the updated access time but an old health so it would incorrectly
    believe that the old health was up-to-date and return it.
    
    This commit reworks the endpoint to store the cached health and the
    time at which it was created in a single, volatile field. This ensures
    that the cached health and its creation time will be visible across
    threads. Note that a race between threads when the cache is stale is
    still possible. This race may result in multiple calls to the
    delegate but these should be harmless.
    
    Closes gh-9454
    7a04708c
Name
Last commit
Last update
.github Loading commit data...
.mvn Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-actuator-docs 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-devtools 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-test Loading commit data...
spring-boot-test-autoconfigure Loading commit data...
spring-boot-tools Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
mvnw Loading commit data...
mvnw.cmd Loading commit data...
pom.xml Loading commit data...