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

Remove proxy from CPProxyManager._lock_proxies upon lock destruction #644

Closed

Conversation

gbarnett-hz
Copy link

@gbarnett-hz gbarnett-hz commented Sep 4, 2023

Removes the lock proxy from CPProxyManager._lock_proxies when the lock is destroyed. I don't think this is a big issue here: it's just a bit better internal bookkeeping. What I understand/have seen these clients are short lived and locks are rarely destroyed (?) due to its implications.

With this patch:

lock = client.cp_subsystem.get_lock("my-distributed-lock").blocking()
fence = lock.lock()
try:
    # do something here
    pass
finally:
    lock.unlock()

lock.destroy() # <-- the lock proxy is removed from CPProxyManager._lock_proxies

Fixes: #643

@gbarnett-hz gbarnett-hz self-assigned this Sep 4, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.50%. Comparing base (1723cc0) to head (20ec479).
Report is 39 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #644      +/-   ##
==========================================
- Coverage   96.53%   96.50%   -0.03%     
==========================================
  Files         358      358              
  Lines       20962    20970       +8     
==========================================
+ Hits        20236    20238       +2     
- Misses        726      732       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@devOpsHazelcast
Copy link
Contributor

PR closed by Hazelcast automation as no activity (>3 months). Please reopen with comments, if necessary. Thank you for using Hazelcast and your valuable contributions

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

Successfully merging this pull request may close these issues.

Potential memory leak: lock not removed from proxies when the lock is destroyed [API-2129]
3 participants