Affects Version/s: 2.1.10 (Lovelace SR10), 2.2 RC3 (Moore)
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11)
OpenJDK 64-Bit Server VM (build 11.0.4+11, mixed mode)
Model name: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
(this is a follow-up of our conversation with Mark Paluch).
Some methods of RedisTemplate are not thread-safe:
- A thread can get a null from the opsFor* methods (that create an instance of *Operations lazily)
- A thread can fail with a NullPointerException when working with a not null instance returned from the opsFor* methods
I attached everything I had disclosed to Mark initially.
The archive contains tests to reproduce the issue, the original patch to fix it and elaborate explanation behind changes.
Mark suggested a little bit different solution to the problem.
I will send a pull request with the patch shortly.
(the original explanation is not inlined here because it is not applicable to the actual changes anymore)