Uploaded image for project: 'Spring Security'
  1. Spring Security
  2. SEC-1338

Poor concurrency in SessionRegistryImpl

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.0.5, 3.0.0.RC2
    • Fix Version/s: 3.1.0.M2
    • Component/s: Core
    • Labels:
      None

      Description

      In org.springframework.security.concurrent.SessionRegistryImpl for fields: principals, sessionIds used Collections.synchronizedMap's and for sessionsUsedByPrincipal field used Collections.synchronizedSet.

      Because of it's poor concurrency of synchronized Collections we should used ConcurrentHashMap and CopyOnWriteArraySet instead.

        Activity

        Hide
        batman Nikita Koksharov added a comment -

        SEC-1338_3.1.0.M2.patch should be applied to current master version in git.

        Show
        batman Nikita Koksharov added a comment - SEC-1338 _3.1.0.M2.patch should be applied to current master version in git.
        Hide
        luke Luke Taylor added a comment -

        Is this really necessary, given normal usage patterns? At the moment, it seems that the use of CopyOnWriteArraySet should not cause a problem. It is used to store the sessions for a principal which should remain small and will not be frequently written to.

        Show
        luke Luke Taylor added a comment - Is this really necessary, given normal usage patterns? At the moment, it seems that the use of CopyOnWriteArraySet should not cause a problem. It is used to store the sessions for a principal which should remain small and will not be frequently written to.
        Hide
        batman Nikita Koksharov added a comment -

        I agree, we could keep CopyOnWriteArraySet in usage. You could back issue to "resolve" state

        Show
        batman Nikita Koksharov added a comment - I agree, we could keep CopyOnWriteArraySet in usage. You could back issue to "resolve" state
        Hide
        luke Luke Taylor added a comment -

        Ok. Thanks for your input .

        Show
        luke Luke Taylor added a comment - Ok. Thanks for your input .
        Hide
        issuemaster Spring Issuemaster added a comment -
        Show
        issuemaster Spring Issuemaster added a comment - This issue has been migrated to https://github.com/spring-projects/spring-security/issues/1584

          People

          • Assignee:
            luke Luke Taylor
            Reporter:
            batman Nikita Koksharov
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development