With methods set(value) and setException(new Exception()) executed under race following cases are possible:
- Both methods return false but SuccessCallback is executed
- Both methods return false but FailureCallback is executed
I consider these cases as two flavors of the same problem - actually I expect that one of two methods will always return true.
Jcstress-based tests may be found here:
Also I tried to reproduce the problem without jcstress to better understand it and make sure that it lies not in my poor understanding of jcstress:
This test does not reproduce the problem as reliably as jcstress-based one, but sometimes it still reproduces both flavors of the problem in the single run.