Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-5906

PATCH request with null rev invoked twice at the same time causes infinite loop

    Details

    • Support Ticket IDs:

      Description

      To reproduce, copy the attached workflow archive to the workflow folder.

      Create the role "testRole" :

      PUT openidm/managed/role/testRole
      
      {
          "name" : "testRole", "description" : "testRole", "approver" : "QAMR-WECS", "roleType" : "normal"
      }
      
      

      Create a new user, with password, then log as the user; launch the "Add Role User Approval" process twice, with an identical Start Time for both.

      The workflow uses this call to add a role to the user :

      [...]
      newAccess = [:]
      	newAccess.put('_ref', 'managed/role/testRole')	
      	patchParams = [[operation:'add', field:'/roles/-', value : newAccess]]
      	newUserIdm = openidm.patch('managed/user/'+ userIDM._id, null, patchParams)
      [...]
      

      This launches two simultaneous threads, trying to update the same object at the same time. The first update wins, the second looses due to "PreconditionFailedException"; however, the logic in the code is erroneous, as it loops forever.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                patrickdiligent patrick diligent
                Reporter:
                patrickdiligent patrick diligent
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: