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

fix: Prevent memory leaks caused by pull query logging #5532

Merged

Conversation

AlanConfluent
Copy link
Member

Description

This changes Pull Queries to use a fixed logger name rather than use the query id. KSQL otherwise gets OOM Errors after doing high QPS for half an hour, due to creating so many unique loggers.

This is because both in the class io.confluent.common.logging.StructuredLoggerFactory and in the slf4j Logger factory itself, they keep a ConcurrentMap of name -> Logger to reuse loggers. After many, many queries, you eventually get OOMs if you create a new one every pull query.

Fixes #5527

Testing done

Profiled memory before and after change.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@AlanConfluent AlanConfluent requested a review from a team as a code owner June 2, 2020 23:55
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

LGTM! Nice sleuthing

Copy link
Contributor

@rodesai rodesai left a comment

Choose a reason for hiding this comment

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

LGTM

@AlanConfluent AlanConfluent merged commit 723b6cb into confluentinc:master Jun 3, 2020
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.

Pull Queries: Logger in PullQueryExecutor results in Memory Leak
3 participants