Skip to content

Fix possible logger leak #362

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

Merged
merged 1 commit into from
Apr 26, 2017
Merged

Fix possible logger leak #362

merged 1 commit into from
Apr 26, 2017

Conversation

lutovich
Copy link
Contributor

Various components like session and connection include their identifiers in logs for diagnostic purposes. Most did this by creating loggers with specialized names. This is a problematic approach because it forces logging framework to create many distinct logger objects. JUL keeps such loggers as weakly referenced values in a map. This caused excessive GC activity and application failures.

This PR introduces a logger able to prepend diagnostics to messages and delegate rest of the work. It makes identifiers part of messages. Session, connection and other objects that require identification in logs now use this logger.

Example log message:
2017-04-25 02:36:47,319 [ConnectionQueue] [127.0.0.1] Error disposing connection

Related to #360
Fixes #359

@lutovich
Copy link
Contributor Author

@if6was9 could you please take a look? I think this change allows us to keep session ids for diagnostics and should fix logger leak.

@if6was9
Copy link

if6was9 commented Apr 25, 2017

I think this will fix the GC issue.

@lutovich lutovich force-pushed the 1.2-fix-log-leak branch 2 times, most recently from ba0cf3f to 91969a5 Compare April 25, 2017 20:56
Various components like session and connection include their identifiers
in logs for diagnostic purposes. Most did this by creating loggers with
specialized names. This is a problematic approach because it forces
logging framework to create many distinct logger objects. JUL keeps
such loggers as weakly referenced values in a map. This caused
excessive GC activity and application failures.

This commit introduces a logger able to prepend diagnostics to messages
and delegate rest of the work. It makes identifiers part of messages.
Session, connection and other objects that require identification in
logs now use this logger.

Example log message:
 `2017-04-25 02:36:47,319 [ConnectionQueue] [127.0.0.1] Error disposing connection`
@zhenlineo zhenlineo merged commit 3f78fe9 into neo4j:1.2 Apr 26, 2017
@lutovich lutovich deleted the 1.2-fix-log-leak branch April 26, 2017 19:56
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.

3 participants