Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Update Lock Implementation using GUIDs #144

Open
gkalele opened this issue Oct 24, 2016 · 2 comments
Open

Update Lock Implementation using GUIDs #144

gkalele opened this issue Oct 24, 2016 · 2 comments

Comments

@gkalele
Copy link

gkalele commented Oct 24, 2016

Looking at the implemention in lock.go and comparing with the Lock recipe from the Zookeeper recipes page, it appears that they now recomment creating lock nodes with a prefix of <GUID>-lock- instead of just lock- to handle a special case.

https://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_Locks

Call create( ) with a pathname of "_locknode_/guid-lock-" and the sequence and ephemeral flags set. The guid is needed in case the create() result is missed. See the note below.

@jgehrcke
Copy link

jgehrcke commented Sep 3, 2018

Does the current implementation in https://github.com/samuel/go-zookeeper/blob/master/zk/lock.go even follow one of the "official" lock recipes? There are no code comments indicating that as far as I can see. Would be good to know exactly what the goal was so that it's easier to decide what a bug is and what not.

@MrWinstead
Copy link

@gkalele, #209 now allows for custom lock names based on a lock name builder. Does that fit your usecase?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants