New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metrics-guice Registers instrumented MBeans multiple times #201
Comments
You seem to bind the same mbean multiple times in the same VM, from what it looks like unit tests ? The mbean server is a VM-level singleton, so any mbeans registered as part of your test will stay around even after the test is done unless they are explicitly de-registered. |
It actually occurs the first time I run that test for some type (such as if I rename T to something else). It looks like JMXReporter.registerBean is called twice for the same objectName. Here are the two call stacks:
It also occurs during runtime, such as when a db health check is run:
|
…xReporter which competes with the default one
…xReporter which competes with the default one
Any chance of getting a 2.1.x release with this fix? The 3.0.0 ETA is unknown and @timed annotations are pretty much unusable without this fix. |
Fixed by #202, unless I'm missing something. 2.1.2 has this fix. |
I noticed that metrics-guice 2.1.1 attempts to register instrumented MBeans multiple times, resulting in an internal InstanceAlreadyExistsException (logged as WARN). I'm not sure if this has any side-effects other than the WARN message:
Corresponding WARN:
The text was updated successfully, but these errors were encountered: