We noticed some unexpected behaviour when using Infinispan in invalidation mode. It occurs sometimes. Is this a race condition, or is cache remove() supposed to behave like this when it's setup in invalidation mode?
Create two cache managers.
Establish a cluster between them.
Create an invalidating (sync) cache on each node.
Configure a shared cache store.
Put entry on node 1.
Try to remove the entry on node 2.
About 40% of the time remove() fails to return the removed value, and we get null instead.
A ticket was filed in the tracker to for this issue, and it contains a Java test.