Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27233

Concurrent group update leads to duplicate members

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.10, 11.1-SNAPSHOT
    • Fix Version/s: HOTFIX_10.10, 11.x
    • Component/s: Automation, Core
    • Tags:
    • Backlog priority:
      450

      Description

      1. install Nuxeo
      2. start Nuxeo
      3. create an empty group:
        curl -H 'Content-Type:application/json+nxrequest' -X POST -d '{"params":{"groupname":"mytestgroup","members":[]},"context":{}}'   -u Administrator:Administrator http://localhost:8080/nuxeo/api/v1/automation/Group.CreateOrUpdate
        
      1. double-check it is empty:
        curl -s -H 'Content-Type:application/json+nxrequest' -X GET -H "fetch.group: memberUsers,memberGroups" -u Administrator:Administrator http://localhost:8080/nuxeo/api/v1/group/mytestgroup | jq .
        {
          "entity-type": "group",
          "groupname": "mytestgroup",
          "grouplabel": "mytestgroup",
          "id": "mytestgroup",
          "properties": {
            "tenantId": null,
            "description": null,
            "grouplabel": null,
            "groupname": "mytestgroup"
          },
          "memberUsers": [],
          "memberGroups": []
        
      1. now add twice the member through 2 concurrent requests:
        curl -H 'Content-Type:application/json+nxrequest' -X POST -d '{"params":{"groupname":"mytestgroup","members":["Administrator"]},"context":{}}' -u Administrator:Administrator http://localhost:8080/nuxeo/api/v1/automation/Group.CreateOrUpdate & curl -H 'Content-Type:application/json+nxrequest' -X POST -d '{"params":{"groupname":"mytestgroup","members":["Administrator"]},"context":{}}'   -u Administrator:Administrator http://localhost:8080/nuxeo/api/v1/automation/Group.CreateOrUpdate &
        
      1. observe the group now contains twice the same user:
        curl http://localhost:8080/nuxeo/api/v1/group/mytestgroup | jq .
        {
          "entity-type": "group",
          "groupname": "mytestgroup",
          "grouplabel": "mytestgroup",
          "id": "mytestgroup",
          "properties": {
            "tenantId": null,
            "description": null,
            "grouplabel": null,
            "groupname": "mytestgroup"
          },
          "memberUsers": [
            "Administrator",
            "Administrator"
          ],
          "memberGroups": []
        }
        

      Note: this does not happen when trying to add twice the same user in a single request:

      curl -H 'Content-Type:application/json+nxrequest' -X POST -d '{"params":{"groupname":"administrators","members":["Administrator","Administrator"]},"context":{}}'   -u Administrator:Administrator http://localhost:8080/nuxeo/api/v1/automation/Group.CreateOrUpdate
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ffischer Frantz Fischer
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                PagerDuty

                Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.