awslabs / amazon-dynamodb-lock-client

The AmazonDynamoDBLockClient is a general purpose distributed locking library built on top of DynamoDB. It supports both coarse-grained and fine-grained locking.
Other
472 stars 85 forks source link

Add reentrant option for acquireLock() #57

Closed lcabancla closed 3 years ago

lcabancla commented 3 years ago

Issue #, if available: https://github.com/awslabs/amazon-dynamodb-lock-client/issues/56

Description of changes:

Add a reentrant option for acquireLock(). With this set to true, the lock client will check first if it already owns the lock. If it already owns the lock and the lock is not expired, it will return the lock immediately. If this is set to false and the client already owns the lock, the call to acquireLock will block.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

lcabancla commented 3 years ago

@kapilsingh5050 Thanks for the approval. Added a test. I don't have write access to merge. Also, I am not familiar with the process of releasing a version. Do you know how to do that?

Screen Shot 2021-06-28 at 11 30 38 AM

kapilsingh5050 commented 3 years ago

I also don't have access to merge these PRs. I'm also not familiar with the release process. @KasulaVamsi Can you check if you have permissions to merge?