Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  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

    • Bug
    • Resolution: Fixed
    • Low
    • 6.1.0
    • 5.0.0
    • Pull Requests
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: