LuciferYang opened a new issue, #13437: URL: https://github.com/apache/gravitino/issues/13437
### Version main branch ### Describe what's wrong `MetricsSystem` registers a metrics source via Dropwizard's `MetricRegistry.register(name, sourceRegistry)`, which attaches an internal listener to the source's registry that cannot be removed afterwards. `unregisterSource` only removes the already-forwarded child metrics, so a stale source (for example a catalog evicted from cache) keeps re-injecting lazily created metrics into the shared registry. Those ghost metrics stay in `/metrics` and JMX forever, and re-registering under the same name can throw `IllegalArgumentException` when a re-injected child collides. ### How to reproduce 1. Register a metrics source, then unregister it. 2. Trigger creation of a lazily created metric on the old source (or re-register a source with the same name). 3. Ghost metrics remain exposed, or re-registration throws `IllegalArgumentException`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
