java - How can I know if the curator InterProcessSemaphoreMutex was re-acquired after it was lost? -


i using interprocesssemaphoremutex curator recipe ensure application process singleton. mutex can lost because of transient network errors or application pausing (because of gc, example). using retry policy process can make attempt reacquire lock. want application process exit if unable re-acquire lock within (say) 5 minutes.

the documentation recipe suggests can listen connectstatechange events. event lost indicates connection zookeeper has been lost , process lost lock well. way, process can detect if loses lock.

how can process check if successful in re-acquiring lock? can't find method on mutex can give me information. suspiciously useful "isacquiredinthisprocess" method doesn't give me information.

i not sure mean retrypolicy, of curator objects have retry policy (distributedatomiclong example).

i don't see how use interprocesssemaphoremutex, interprocesssemaphoremutex has acquire(long time, timeunit unit) method, using 5 minutes won't solve problem?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -