Jeremy, thx very much for providing a unit test for this. It makes it easier for us to evaluate why it fails. We'll reply asap.
Jeremy, I'm assuming that the test works fine for you but it should fail?
I've just run it locally and it fails indicating that it detects a write skew.
Your ported over test: https://github.com/galderz/infinispan/commit/94bdd9c2fbc3ac1e6d3af2889208293fed147e40
The test _fails_ for me also.
The same assertion at line 101 fails. Meaning that 'result' is false for the thread so that at least one uniqueValuesSet.add(value) returned false (an attempt to add a duplicate value) for some value = v (say).
This indicates to me that it did not detect a write skew: i.e. both threads read the counter as v - 1, incremented it to v and successfully place it back into the cache. Instead I would expect one thread to throw an exception (on either the put or the commit).
1 of 1 people found this helpful
Jeremy, I've had a good look at the test and in some cases, write skew is detected sometimes (see logs) but most often it's not, so I think this is a bug.
I've created https://issues.jboss.org/browse/ISPN-1941 to get this solved.
Many thanks Galder.