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

Expunge stale loggers in InternalLoggerRegistry on method invocation #3474

Open
wants to merge 5 commits into
base: 2.x
Choose a base branch
from

Conversation

Suvrat1629
Copy link
Contributor

@Suvrat1629 Suvrat1629 commented Feb 19, 2025

This PR updates InternalLoggerRegistry to automatically remove stale loggers when its methods are invoked.
Changes Introduced:
Introduced a ReferenceQueue to track loggers that have been reclaimed by the garbage collector.
Implemented expungeStaleEntries(), which removes stale loggers before executing registry operations.
Updated methods like getLogger() and computeIfAbsent() to invoke expungeStaleEntries() before proceeding.
Added tests to verify stale loggers are expunged without relying on private methods.

Fixes #3430

@Suvrat1629
Copy link
Contributor Author

@vy I have always had a hard time with test cases, I have opened a pr regardless please take look and provide further insights on how i can improve it.

Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

Please put back all the removed comment blocks.

@Suvrat1629
Copy link
Contributor Author

Ok sorry about that, I have put back all the comment blocks as they were.

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

Successfully merging this pull request may close these issues.

Expunge stale entries in InternalLoggerRegistry
3 participants