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.
- create reaper (specify threshold time. default 5 minutes)
- start reaper
- add path
thread.wait(//time more threshold)- 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
Post a Comment