Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-78256

Parallel requests to update a system field can lead to values being lost

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 9.4.14
    • REST API

      Issue Summary

      This is reproducible on Data Center: Yes

      When parallel requests are made to update a field, a race condition can occur that causes the values from some of the updates to be lost. There may be a load component as well because captured examples show Jira receiving multiple requests before it responds to the first one

      The API request are made with "update" and "add", that should always add the values provided in the requests to the current values of the field:

      { "update": { "fixVersions": [ {"add": "newVersion"} ] } } 
      • The HTTP Access logs will show Jira receiving multiple requests before it can respond. For example:
      <IP> <i Request ID 1> <Username> [xx/xxx/2024:00:15:22 -0400] "PUT JIRA_URL/rest/api/2/issue/<Issue Key> HTTP/1.1" - - - - <User Agent> <Session ID 1> 
      <IP> <i Request ID 2> <Username> [xx/xxx/2024:00:15:22 -0400] "PUT JIRA_URL/rest/api/2/issue/<Issue Key> HTTP/1.1" - - - - <User Agent> <Session ID 2>  
      <IP> <o Request ID 1> <Username> [xx/xxx/2024:00:16:23 -0400] "PUT JIRA_URL/rest/api/2/issue/<Issue Key> HTTP/1.1" 204 0 0.4070 - <User Agent> <Session ID 1> 
      <IP> <o Request ID 2> <Username> [xx/xxx/2024:00:16:23 -0400] "PUT JIRA_URL/rest/api/2/issue/<Issue Key> HTTP/1.1" 204 0 0.3270 - <User Agent> <Session ID 2> 
      • HTTP Dump logs will show the Request Data being received. For example:
         {"update":{"fixVersions":[{"add":{"name":"x"}}]}}

       

      Steps to Reproduce

      1. Jira receives an API request to add value "x" to "Field 1"
      2. Jira has not responded to request 1
      3. Jira receives an API request to add value "y" to "Field 1"
      4. Jira responds to request 1
      5. Jira responds to request 2

      Expected Results

      "Field 1" should contain the "x" and "y" values

      Actual Results

      "Field 1" only contains value "y". Value "x" was added and then removed

      The Change History will show the first value being added from the first request and then removed when the second request is processed, which also adds the second value:

       "created": "2024-xx-xxT00:15:22.943-0400",
              "items": [
                {
                  "field": "Fix Version",
                  "fieldtype": "jira",
                  "from": null,
                  "fromString": null,
                  "to": "<ID for Fix version>",
                  "toString": "x"
                }
              ]
            },
            {
              "id": "<ID>",
              "author": {
                "self": "JIRA_URL/rest/api/2/user?username=<username>",
                "name": "<username>",
                "key": "<user key>",
                "emailAddress": "user.email@domain.com",
                "avatarUrls": {
                  "48x48": "JIRA_URL/secure/useravatar?avatarId=<ID>",
                  "24x24": "JIRA_URL/secure/useravatar?size=small&avatarId=<ID>",
                  "16x16": "JIRA_URL/secure/useravatar?size=xsmall&avatarId=<ID>",
                  "32x32": "JIRA_URL/secure/useravatar?size=medium&avatarId=<ID>"
                },
                "displayName": "<User Display Name>",
                "active": true,
                "timeZone": "America/New_York"
              },
              "created": "2024-xx-xxT00:15:22.965-0400",
              "items": [
                {
                  "field": "Fix Version",
                  "fieldtype": "jira",
                  "from": "<Fix Version ID>",
                  "fromString": "x",
                  "to": null,
                  "toString": null
                },
                {
                  "field": "Fix Version",
                  "fieldtype": "jira",
                  "from": null,
                  "fromString": null,
                  "to": "200431",
                  "toString": "y"
                }
              ]
            },  

      Workaround

      The only current option is to space out the requests

              Unassigned Unassigned
              34e46ad8c98b Branden Miars
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: