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

Enhanced Lock Request Handling with TTL Consideration #168

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

keen99
Copy link

@keen99 keen99 commented Nov 13, 2024

  • TTL Consideration: Updated the lock request logic to consider the TTL (Time-To-Live) attribute when determining lock availability. Previously, TTL was ignored during lock requests, relying solely on DynamoDB's eventual purge, which can occur at any time, typically within a few days of expiration. Now, the lock request process checks the TTL to ensure that locks are not granted if the TTL has not yet expired.
  • Testing Enhancements: Added comprehensive tests to verify TTL expiration behavior and ensure locks are correctly released after TTL expiry. This includes simulating process crashes and verifying lock reacquisition.
  • Documentation Update: Updated README.md to reflect changes in TTL handling, clarifying that TTL is automatically managed and no manual configuration is needed for the TTL attribute.
  • Code Refactoring: Refactored code to improve readability and maintainability, including better logging and error handling.
  • Added go test wrapper script (run-tests.sh) for easier local testing

Fixes #166

Full disclosure - I needed a release of this, so my fork has this released as 0.6.0 - I'm not married to this, but the changelog .....is wrong.

keen99 and others added 20 commits November 4, 2024 12:14
is not authorized to perform: dynamodb:DeleteItem on resource: ... because no identity-based policy allows the dynamodb:DeleteItem action

DeleteItem is also required
Update README.md - add DeleteItem
- **TTL Consideration**: Updated the lock request logic to consider the TTL (Time-To-Live) attribute when determining lock availability. Previously, TTL was ignored during lock requests, relying solely on DynamoDB's eventual purge, which can occur at any time, typically within a few days of expiration. Now, the lock request process checks the TTL to ensure that locks are not granted if the TTL has not yet expired.
- **Testing Enhancements**: Added comprehensive tests to verify TTL expiration behavior and ensure locks are correctly released after TTL expiry. This includes simulating process crashes and verifying lock reacquisition.
- **Documentation Update**: Updated `README.md` to reflect changes in TTL handling, clarifying that TTL is automatically managed and no manual configuration is needed for the TTL attribute.
- **Code Refactoring**: Refactored code to improve readability and maintainability, including better logging and error handling.
- Added `go test` wrapper script (`run-tests.sh`) for easier local testing
Enhanced Lock Request Handling with TTL Consideration
 * Add lock/release info log to ensure the user is always informed about lock status.
 * Include detailed information in lock failure logs, showing TTL, expiration, and revision to avoid manual investigation.
 * Introduce a simple CLI-based test in run-tests.sh to demonstrate logging changes during local testing.
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.

this doesnt use the ttl....at all.
1 participant