Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3006

UserManager: concurrent user creation using same intermediate path fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.7
    • Fix Version/s: 2.3
    • Component/s: security
    • Labels:
      None

      Description

      concurrently creating users using same intermediate path fails with "node ... has been modified externally".

      the problem is the intermediate path. if it doesn't exist multiple threads try to create it concurrently:

      o.a.jackrabbit.core.security.user.UserManagerImpl, line 1310ff:

      String[] segmts = defaultPath.split("/");
      NodeImpl folder = (NodeImpl) session.getRootNode();
      String authRoot = (isGroup) ? groupsPath : usersPath;

      for (String segment : segmts) {
      if (segment.length() < 1)

      { continue; }

      if (folder.hasNode(segment)) {
      folder = (NodeImpl) folder.getNode(segment);
      if (Text.isDescendantOrEqual(authRoot, folder.getPath()) &&
      !folder.isNodeType(NT_REP_AUTHORIZABLE_FOLDER))

      { throw new ConstraintViolationException("Invalid intermediate path. Must be of type rep:AuthorizableFolder."); }

      } else

      { Node parent = folder; folder = addNode(folder, session.getQName(segment), NT_REP_AUTHORIZABLE_FOLDER); }

      }

      the attached test case illustrates this issue/

        Attachments

        1. ConcurrentCreateUserTest.java
          3 kB
          Stefan Guggisberg
        2. ConcurrentCreateUserTest.java
          3 kB
          Julian Reschke
        3. ConcurrentCreateUserTest.java
          3 kB
          Julian Reschke
        4. JCR-3006.patch
          7 kB
          Julian Reschke
        5. JCR-3006.patch
          7 kB
          Julian Reschke

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stefan@jira Stefan Guggisberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: