Skip to content

Conversation

@lhotari
Copy link
Member

@lhotari lhotari commented Apr 12, 2021

Motivation

There's a memory leak in tests via Prometheus client default CollectorRegistry. This has an impact in tests when a lot of Pulsar broker instances are created during tests.

Modifications

  • Unregister JettyStatisticsCollector from Prometheus client's default
    Collector registry at shutdown

  • Clear metricsServlet reference at shutdown of PulsarService

    • Unrelated to the collector unregister fix.
    • In tests: helps release the Jetty webserver parts for GC when there are references preventing PulsarService from being GCed.

…down

- Unregister JettyStatisticsCollector from Prometheus client's default
  Collector registry at shutdown

- Clear metricsServlet reference at shutdown of PulsarService
@lhotari lhotari changed the title Unregister JettyStatisticsCollector to fix memory leak in Broker shutdown [Tests] Unregister JettyStatisticsCollector to fix memory leak in Broker shutdown Apr 12, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@merlimat merlimat merged commit f800fde into apache:master Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants