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 memory leak by caused by dynamicconfig value logging #6169

Conversation

taylanisikdemir
Copy link
Member

@taylanisikdemir taylanisikdemir commented Jul 16, 2024

What changed?

Dynamic config values are kept in a map to be compared against previous values for logging purposes. This log was not used in practice at all. It requires huge amounts of memory to keep the last snapshot of all evaluated dynamic config values. The underlying map has no retention so keys like "{configname}{domain}{workflowid}" increase cardinality and stay there forever.

This issue was identified when pprof of a high memory usage history service instance was inspected. The call stack initiated by replication task processor ends up calling GetBoolPropertyFilteredbyDomainIDAndWorkflowID which populates the underlying logValues map per workflow keys that never get deleted.
Screenshot 2024-07-16 at 12 20 09 PM

Why?
Avoid wasting memory and prevent leaks for unused logs.

Copy link
Member

@Groxx Groxx left a comment

Choose a reason for hiding this comment

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

Yea, seems fine to just delete it. Doing anything else would need an LRU of some kind and I largely don't think that's worth the complexity.

@taylanisikdemir taylanisikdemir enabled auto-merge (squash) July 16, 2024 22:53
@taylanisikdemir taylanisikdemir merged commit c9dcc8c into cadence-workflow:master Jul 16, 2024
18 checks passed
@taylanisikdemir taylanisikdemir deleted the taylan/remove_dynamicconf_log branch July 17, 2024 15:29
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.

4 participants