Skip to content

RedisTemplate.opsFor* methods not thread-safe [DATAREDIS-1034] #1605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Sep 12, 2019 · 1 comment
Closed
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

cac03 opened DATAREDIS-1034 and commented

Hello,

(this is a follow-up of our conversation with Mark Paluch).

Problem:

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)


Affects: 2.1.10 (Lovelace SR10), 2.2 RC3 (Moore)

Attachments:

Referenced from: pull request #479

Backported to: 2.1.11 (Lovelace SR11)

@spring-projects-issues
Copy link
Author

cac03 commented

Here is the pull request.

Please note that I also preinitialized DefaultClusterOperations

 

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants