Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-5716

Cross-dc: Possible deadlock when updating 2 userSessions concurrently from both DC

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.4.0.CR1
    • Component/s: None
    • Labels:
      None
    • Docs QE Status:
      NEW
    • QE Status:
      ASSIGNED

      Description

      For the setup of JDG servers based on backup caches (which is cross-site solution supported by Infinispan), there is a possibility of deadlock on JDG server side when there are 2 requests to Keycloak servers in different DCs, which concurrently updates same userSession each on it's own DC. If deadlock happens, the request on Keycloak side will be then also blocked for 10 seconds.

      Then there will be exception in the JDG server log about the timeout. Basically the stacktrace I pasted in the https://issues.jboss.org/browse/JDG-1318 description.

      Sending the backup to the other site is then ignored and Infinispan transaction will just do "local" cluster update and second DC is not notified about the change. So on the Keycloak side, there won't be an exceptions, but consistency won't be there either and there is possibility of lost updates AKA write skews (EG. one clientSession from userSession might be lost).

      More details about the deadlock in https://issues.jboss.org/browse/JDG-1318

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mposolda Marek Posolda
                  Reporter:
                  mposolda Marek Posolda
                  Tester:
                  Vlastislav Ramik
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: