Announcement Announcement Module
Collapse
No announcement yet.
UpdateACL Deadlock Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • UpdateACL Deadlock Error

    We are getting deadlock errors when using the mutable ACL Method UpdateACL. Anyone else having this trouble or know how to avoid this.

    GrantPermission is our custom function and right after that log message mutableAclService.createAcl is called.


    Here is some info from our logs

    0000005100973701a99b14 21:06:37,024 DEBUG [PermissionDaoSpringImpl.java:240 grantPermission] Updating ACL
    @40000000510097371acdabe4 21:06:37,032 DEBUG [AbstractPlatformTransactionManager.java:805 processRollback] Participating transaction failed - marking existing transaction as rollback-only
    @40000000510097371acdb79c 21:06:37,032 DEBUG [HibernateTransactionManager.java:695 doSetRollbackOnly] Setting Hibernate transaction on Session [org.hibernate.impl.SessionImpl@1b7a8939] rollback-only
    @40000000510097371acdbf6c 21:06:37,033 DEBUG [AbstractPlatformTransactionManager.java:893 triggerBeforeCompletion] Triggering beforeCompletion synchronization
    @40000000510097371ace0d8c 21:06:37,033 DEBUG [AbstractPlatformTransactionManager.java:798 processRollback] Initiating transaction rollback
    @40000000510097371ace155c 21:06:37,034 DEBUG [HibernateTransactionManager.java:670 doRollback] Rolling back Hibernate transaction on Session [org.hibernate.impl.SessionImpl@1b7a8939]
    @40000000510097371ace1d2c 21:06:37,035 DEBUG [AbstractPlatformTransactionManager.java:805 processRollback] Participating transaction failed - marking existing transaction as rollback-only

  • #2
    What I am noticing is that most of our updateACL methods take less than half a second. When the deadlock comes up its taking more than a second which is probably why we are getting deadlocks.

    Still not sure why the updateACL method takes much longer only on a few occasions.

    Comment


    • #3
      It seems that you ahve written a custom API for updating the permissions (i.e. PermissionDaoSpringImpl is not provided in the default distribution). This means this is probably more of a Spring Data question and others will not be able to help you without you posting code.

      Comment


      • #4
        We do use our own custom code to set permissions on an object, but in the end we use, what I could see a common way of setting the permissions on objects that I've seen elsewhere.

        In PermissionDaoSpringImpl our function to grant permissions uses this code snipet to set the permissions:

        try {
        childAcl = (MutableAcl) mutableAclService.readAclById(childObjectIdentity) ;
        } catch (NotFoundException nfe) {
        childAcl = mutableAclService.createAcl(childObjectIdentity);
        childAcl.insertAce(childAcl.getEntries().length,
        BasePermission.ADMINISTRATION,
        getSpringSid(currentUser), true);
        }
        if (childAcl != null && childAcl.getParentAcl() == null) {
        try {
        childAcl.setParent(parentAcl);
        mutableAclService.updateAcl(childAcl);

        } catch (NotFoundException nfe) {
        logger.warn("could not set parent for " +
        childObjectIdentity.getJavaType().getSimpleName() +
        ".id=" + childObjectIdentity.getIdentifier().toString(), nfe);
        } catch (AlreadyExistsException aee) {
        logger.debug("not sure how we got here", aee);
        }
        }

        Comment


        • #5
          I've been looking into this further. What I see is that there are maybe 5 transactions running at the same time. Sometimes 3 or 4 of these transactions will try to update the ACL tables at the same time within a span of a second.

          This causes the deadlock errors and our permissions not be set properly and rollback errors being throwing.

          Is there a way to efficiently manage multiple transactions needing to access and update the acl tables?

          Comment

          Working...
          X