Skip to content
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

Remove private static cache from MongoDbHealthCheck #2148

Open
adamsitnik opened this issue Jan 22, 2024 · 0 comments
Open

Remove private static cache from MongoDbHealthCheck #2148

adamsitnik opened this issue Jan 22, 2024 · 0 comments
Assignees
Labels

Comments

@adamsitnik
Copy link
Collaborator

MongoDbHealthCheck is maintaining it's private static cache of instances. It's wrong, as it can cause a memory leak (it won't ever be freed).

Moreover, it's can create instances of MongoClient. This is wrong, as it can lead into a situation when we have multiple instances of MongoClient that are connected to the same DB: one used by the app and another created and used by the health check. And we should have only one.

We should do the same as in #2040, #2116 and #2096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants