-
Notifications
You must be signed in to change notification settings - Fork 990
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
ConcurrentModificationException when late meter filters are added #5489
Comments
Fixes micrometer-metrics#5489 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Fixes micrometer-metrics#5489 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Thanks for the report. I was able to reproduce the issue running the specified test in Keycloak. I'm working on making a minimal test to reproduce it in our test suite before we decide on the best solution. We need to do something on the Micrometer side to handle this regardless, but I'm curious how difficult would it be to change things in Quarkus/Keycloak to ensure all MeterFilters are configured before meters are registered in this case? I did not look into detail about which parts of the code are configuring MeterFilters and which are registering meters. |
Fixes micrometer-metrics#5489 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
@shakuzen Great!
I don't know so many details about how Quarkus exactly handles that, but @brunobat mentioned something with regards to Quarkus in this #4920 (comment). jfyi - In Keycloak, we use one custom MeterFilter, but even when I disable it, the issue still occurs (so no question about static/runtime init of the specific meter filter). cc @gsmet |
As mentioned in #4920 (comment), There will always exist MeterFilters that require runtime data and therefore will be configured after the Meters are instantiated. |
Fixes micrometer-metrics#5489 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Fixes micrometer-metrics#5489 Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Fixes micrometer-metrics#5489 Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Fixes micrometer-metrics#5489 Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Signed-off-by: Martin Bartoš <mabartos@redhat.com>
The fix is available in snapshots as 1.13.5-SNAPSHOT now. Would you be able to try with that and verify the CME isn't happening anymore in your tests? |
@shakuzen Sure, I'll do it. |
@shakuzen +1 I can confirm, that the fix resolved the issue on our side as I'm unable to reproduce it anymore. The issue reproducible test usually failed after ~10 startups. Test executed again >~100x with success. Included JARs in our distribution (
|
@shakuzen Hi, when can we expect the 1.13.5 release? :)) |
It's scheduled for October 14. Dates for the upcoming releases are set on the GitHub milestones (as long as we don't forget to set them): https://github.com/micrometer-metrics/micrometer/milestone/264 |
@shakuzen Oh, that's so unfortunate. This issue is a blocker for us as our major release relies on it. We also need to include it in the Quarkus LTS. Do you really need to stick to that date with this patch release? Can we prioritize, or escalate it somehow from our side? The thing is, whether would be possible to release this patch release asap, and the planned workload for this release postpone to 1.13.6? Thanks |
Given the nature of this bug and the difficulty in working around it without significant work, we've released |
@shakuzen Thank you very much! :)) |
Thanks for the quick release, it's very much appreciated! |
Describe the bug
In Keycloak, we're facing an issue (keycloak/keycloak#33246) that the server is unable to start when metrics are enabled - we use Quarkus under the hood with the Quarkus Micrometer extension.
It started to happen after the Micrometer 1.13.x upgrade on the Quarkus side.
It happens only sometimes, and is reproducible after multiple start/stops of Keycloak (Quarkus-based) server.
The issue is probably touching the addition of meter filters after the creation of Meters described here: #4920
The related log:
Environment
To Reproduce
How to reproduce the bug:
f.e. this test case https://github.com/keycloak/keycloak/blob/main/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartCommandDistTest.java#L134
Expected behavior
No
ConcurrentModificationException
Additional context
It seems the problem is lack of synchronization
The text was updated successfully, but these errors were encountered: