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

[OPIK-457] Fix Redis lock keys leak #730

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

thiagohora
Copy link
Contributor

@thiagohora thiagohora commented Nov 27, 2024

Details

Radisson doesn't delete a lock key from Redis after releasing it by default. To tackle this issue, we are adding a new configuration, ttlInSeconds. This configuration will be used to set a ttl time for the lock every time a thread acquires a lock.

Issues

OPIK-457

Testing

  • Check if a lock is evicted from Redis after ttl

@thiagohora thiagohora self-assigned this Nov 27, 2024
@thiagohora thiagohora requested a review from a team as a code owner November 27, 2024 09:40
@thiagohora thiagohora force-pushed the thiagohora/OPIK-457_fix_redis_lock_key_leak branch from a13cc2f to bffc42a Compare November 27, 2024 09:47
Copy link
Contributor

@idoberko2 idoberko2 left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Collaborator

@andrescrz andrescrz left a comment

Choose a reason for hiding this comment

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

Just two minor comments, the rest LGTM. Thanks for putting this together!

Comment on lines +32 to +33
__ -> log.debug("Lock {} released successfully", locked),
__ -> log.warn("Lock {} already released", locked));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: wrap escaped values in the logs between single quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding both in a next review

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: please clean up all these JUnit assertions and move to assertJ.

@thiagohora thiagohora merged commit 26aaa23 into main Nov 27, 2024
6 of 7 checks passed
@thiagohora thiagohora deleted the thiagohora/OPIK-457_fix_redis_lock_key_leak branch November 27, 2024 10:09
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