Skip to content

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

Merged
hjr265 merged 1 commit intogo-redsync:masterfrom
KeiichiHirobe:use-until
Aug 29, 2021
Merged

Fix ExtendContext, and export until for client to check the validity of the acquired lock.#71
hjr265 merged 1 commit intogo-redsync:masterfrom
KeiichiHirobe:use-until

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.

2 participants