79372512

Date: 2025-01-20 20:00:35
Score: 2.5
Natty:
Report link

This is an old post but still relevant to my issue. I have two replicas in a k8s cluster. The pods share re-entrant InterProcessMutex on ZK. Now, I want to be able to release the lock held by a thread in pod A from pod B, i.e. from one JVM requested to be release in another JVM. But, an attempt to release in the call-back passed to listener in makeRevocable() will fails since that thread is not the one that holds the lock, and of course the class is not exposing the lock's owner, so unless that metadata is also saved somewhere on ZK to be shared there's no way of knowing it. It seems to me an attempt to release would only work if it's issued somewhere within the same thread. So I find that makeRevocable() doc is rather sparse and in this regard misleading. Also, even InterProcessSemaphoreMutex will only work within the same JVM.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Massod