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

Backport OPENIDM-5906: PATCH request with null rev invoked twice at the same time causes infinite loop

    Details

      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:
                mark.offutt Mark Offutt [X] (Inactive)
                Reporter:
                cgdrake Chris Drake
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: