Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-11527

Attempting to create several instances of the same pull request at the same time can give a 500 error code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: 5.0.0
    • Fix Version/s: 6.1.0
    • Component/s: Pull Requests
    • Labels:
      None

      Description

      When a pull request is being created, there is a 'uniqueness' check performed to make sure that there are no existing pull requests with the exact same from and to refs.

      If there is already an existing pull request with the same refs, then the pull request creation is rejected with an error message "Only one pull request may be open for a given source and target branch".

      However, if multiple requests are performed at the exact same time with the same refs, it is possible for the uniqueness check to pass (there are no existing pull requests with these refs) and then more than one request gets inserted into the database (the uniqueness is not enforced in the db).

      Any subsequent attempt to create a pull request with the same refs will not return the above error message, but instead will return a 500 error code, "query did not return a unique result: 2" (this error is because the uniqueness check assumes there will never be more than 1 entry - but in the scenario just described it is possible to have more than 1 entry).

      Workaround

      There is no workaround necessary

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fdoherty@atlassian.com Frank Doherty
              Reporter:
              fdoherty@atlassian.com Frank Doherty
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: