Skip to content

Conversation

@nicholashagen
Copy link

The MetricFilter that delegates to the CodahaleMetricWriter fails when taking several parallel requests to the same URL as it tries to update a gauge which causes a registry.remove followed by registry.register. The latter fails if two threads call register back to back as the first will register and the second will fail as having already been registered.

This pull request adds a test case showcasing the error and offers a fix by synchronizing on the registry. Synchronizing is not the best choice due to blocking in the parallism, but I do not see a better way to avoid the error scenario with the API that Codahale exposes.

@dsyer
Copy link
Member

dsyer commented Mar 22, 2014

Thanks. Did you (and can you if not) fill in the contributor's agreement (link in README)?

@dsyer dsyer closed this in b824a6e Mar 22, 2014
@philwebb philwebb added this to the 1.0.0.RELEASE milestone Mar 25, 2014
gigfork pushed a commit to boostrack/spring-boot that referenced this pull request Apr 21, 2014
mdeinum pushed a commit to mdeinum/spring-boot that referenced this pull request Jun 6, 2014
Liwenbai pushed a commit to Liwenbai/spring-boot that referenced this pull request Jun 10, 2025
com.sun.jndi.ldap.LdapCtxFactory is not supposed to be used by anyone but the 'java.naming' module in post Java 8 world.

Fixes spring-projects#543
Liwenbai pushed a commit to Liwenbai/spring-boot that referenced this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants