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

Resolve memory leak caused by circular reference in client finalizer #441

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

reugn
Copy link
Member

@reugn reugn commented Jul 8, 2024

A circular reference between the client object and the cluster object prevents the client's finalizer from executing, resulting in a memory leak. The issue can be reproduced by creating and closing multiple client instances in a loop.
To resolve this, the client instance has been injected into the batch commands directly.

@reugn reugn requested a review from khaf July 8, 2024 15:54
@khaf
Copy link
Collaborator

khaf commented Jul 8, 2024

@reugn Thanks for the pull request. Is the issue the finalizer not being called, or the memory leak after the finalizer call?

@reugn
Copy link
Member Author

reugn commented Jul 8, 2024

The finalizer is not being called, causing the memory leak.

@khaf khaf merged commit f2b691d into stage Jul 16, 2024
8 checks passed
khaf added a commit that referenced this pull request Jul 22, 2024
* Update CHANGELOG
* [CLIENT-3022] Close() throws a nil point error on ProxyClient without Authentication
* [CLIENT-3044] Resolve memory leak caused by circular reference in client finalizer (#441)
* [CLIENT-3045] Move proxy client build behind a build flag
This removes the GRPC compilation and potential namespace conflict from the default build and moves it behind the compiler build flag "as_proxy"
* Update dependencies
* [CLIENT-3047] Fix pointer value assignment in baseMultiCommand.parseKey (#443)
* [CLIENT-3048] Use precomputed ops variable in batchIndexCommandGet.executeSingle (#442)
* [CLIENT-3046] Wrong return type in Single Key Batch Operations with Multiple Ops per Bin
* [CLIENT-3022] Optimize the ticker
* [CLIENT-3022] Close the ticker
* [CLIENT-3049] Use a specialized pool for grpc conns to prevent premature reaping
Also fixes namespace parameter for a few code examples.
* Skip a few unsupported tests in the DBAAS environment

---------

Co-authored-by: Eugene R. <[email protected]>
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.

2 participants