I was playing around some cache configurations with 4.2.0.ALPHA2, and I encountered a strange scenario.
I have a pool of keys that I use the "cache.withFlags( ZERO_LOCK_TIMEOUT ).lock( key )" construct. The idea is if I can't acquire a key, I move to the next one in the list. Works well, especially with the changes made to the 4.2 branch.
However, I used this where the <default/> tag had deadlock detection enabled. In this case, no lock could ever be acquired, even on a single node environment.
Now obviously, the above implementation doesn't need DLD and a workaround exists, but I'm curious as to if this is expected behavior. If this is (given how DLD works), can such a configuration be flagged?
So cache.withFlags( ZERO_LOCK_TIMEOUT ).lock( key ) is never able to acquire a lock, even if the key is not lock for sure? If so this sounds like a bug: mind creating a JIRA? What API do you use for to check if lock has been acquired?