Curator - InterProcessMutex lock does not delete nodes

Does anyone know which of the curator’s blocking recipes create ephemeral nodes?

I tested InterProcessMutex lock, but as far as I can see (with zkClient ), it does not delete nodes after release or closes the session.

This is the code that I use for lock keys.

 public void lock(final LockKey lockkey, final LockAcquiredListener listener) throws Exception { final String lockKeyPath = lockkey.toString(); LOGGER.info("Trying to acquire the lock {}", lockKeyPath); final InterProcessMutex lock = new InterProcessMutex(client, LOCKS_PREFIX + lockKeyPath); if (!lock.acquire(LOCK_MS_TIME_OUT, TimeUnit.MILLISECONDS)) { LOGGER.info("Could not acquire the lock {}", lockkey.toString()); throw new LockAcquisitionTimeOutException("Could not acquire the lock: " + lockKeyPath); } try { if (listener != null) { LOGGER.info("Lock acquired for key {}", lockKeyPath); listener.lockAcquired(lockkey); } } finally { LOGGER.info("Release acquired key {}", lockKeyPath); lock.release(); } } 

Thanks!

+8
java apache-zookeeper curator
source share

No one has answered this question yet.

See related questions:

2248
Is the finally block always executable in Java?
1722
Why does this code use random lines to print "hello world"?
1492
Does Java support default parameter values?
1338
Why does Java have transition fields?
1249
How does the Java loop work for each loop?
17
Lock recipe concerns
3
Cleaning the Curator / Zookeeper
3
Lock for JavaME
0
Apache Curator Lock Error
0
Curator mutex lock failed after reconnecting

All Articles