Concurrent DELETE issue API calls will error when the issues are from the same parent

XMLWordPrintable

    • 2
    • Severity 2 - Major

      Issue Summary

      The DELETE method for rest/api/3/issue (used to delete issues), will error out (400s mentioning system error and 500s) when deleting sub-tasks if:

      • You send multiple calls at the same time and,
      • The sub-tasks belong to the same parent

      I tested this with around 5 sub-tasks, the more the likelyhood of error increases

      Steps to Reproduce

      1. Create around 5 sub-tasks under the same parent
      2. Send 5 DELETE /rest/api/3/issue calls to delete the sub-tasks at the same time.

      In my tests, I used curl with the '&' joiner, to ensure calls were fired at the same time, as below:

      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-31  -w "%{http_code}" & \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-32 -w "%{http_code}" & \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-33 -w "%{http_code}" & \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-34 -w "%{http_code}" & \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-35 -w "%{http_code}"
      

      Expected Results

      The calls will return 2xx responses and the sub-tasks deleted

      Actual Results

      We receive 400s that mention "System errors" in the payload and also 500s

      Workaround

      Make synchronous calls (where the next call will only start after the initial previous one finished). I tested and this works in Curl by using the ';' command joiner, which ensures synchronicity.

      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-25 -w "%{http_code}" ; \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-26  -w "%{http_code}" ; \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-27 -w "%{http_code}" ; \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-28 -w "%{http_code}" ; \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-29 -w "%{http_code}" ; \
      curl -u <e-mail>:<api_token> -X DELETE -H "Content-Type: application/json" https://<instance>.atlassian.net/rest/api/3/issue/GAN-30 -w "%{http_code}"
      

            Assignee:
            Unassigned
            Reporter:
            Eduardo Masiero
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: