Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-1034

RedisTemplate.opsFor* methods not thread-safe

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.10 (Lovelace SR10), 2.2 RC3 (Moore)
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Description

      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)

        Attachments

          Activity

            People

            • Assignee:
              mp911de Mark Paluch
              Reporter:
              cac03 cac03
              Last updater:
              Mark Paluch
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: