Curator/Zookeeper lock cleanup -


i’m using interprocesssemaphoremutex distributed locking recipe.

a typical path lock might be

/lock/calendar/uuid

where uuid of course uuid , hence many lock paths may generated.

i’d assume these paths need cleaned eventually, i’ve tried using childreaper , reaper after unlock lock.

childreaper kind of works. if add /lock/calendar/uuid happily removes children. log shows removes leases , locks , node shown gone in zkclient begins complaining in seemingly endless loop path gone. despite trying mode.delete , mode.until gone.

reaper nothing, because /lock/calendar/uuid has children.

am missing something? not need clean these locks? need worry concurrency wise about.

the steps has follows reaper.

  1. create reaper (specify threshold time. default 5 minutes)
  2. start reaper
  3. add path
  4. thread.wait(//time more threshold)
  5. close reaper

if check zookeeper now, node deleted.

note: work leaf node when path empty.

p.s: child reaper doesn't work me. if can put steps used child reaper in comment or in question, helpful.


Comments

Popular posts from this blog

How to group boxplot outliers in gnuplot -

cakephp - simple blog with croogo -

bash - Performing variable substitution in a string -