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

Fix ExtendContext, and export until for client to check the validity of the acquired lock. #71

Merged
merged 1 commit into from
Aug 29, 2021

Conversation

KeiichiHirobe
Copy link
Contributor

I propose 2 changes.

Fix ExtendContext to check validity time and update until.

As explained here, we need check validity time.

The client should only consider the lock re-acquired if it was able to extend the lock into the majority of instances, and within the validity time (basically the algorithm to use is very similar to the one used when acquiring the lock).

Add Until() to export until

To export until is useful for client to check the validity of the acquired lock.
Furthermore, I think there is a potential bug in current implementation of ValidContext/Valid. I'm going to create an issue about that soon.

@hjr265 hjr265 merged commit 13a6e28 into go-redsync:master Aug 29, 2021
@hjr265
Copy link
Member

hjr265 commented Aug 29, 2021

@KeiichiHirobe Thank you for the pull request. Sorry to take a while to get to this.

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.

None yet

2 participants