Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-12920

Author/reviewer selector on Pull Request page can exhaust DB connections

    XMLWordPrintable

Details

    Description

      Issue Summary

      The participant selectors (either author or reviewer) on Pull Request page can exhaust DB connections. When finding either by author or reviewer, for each character typed a REST request is made. When subsequent characters are typed outstanding requests are cancelled, however this doesn't actually interrupt/cancel the operation on the server. As a result large numbers of concurrent request can be in flight.

      This problem was seen on stash.a.c and on a few occasions has been the dominant cause of DB connection exhaustion. We should investigate:

      • Adding some debouncing
      • The efficiency of the query being executed

      Steps to Reproduce

      1. Go to the Pull Request list page (/projects/<proj>/repos/<repo>/pull-requests)
      2. Type a long strong, character at a time. For example "The quick brown fox jumps over the lazy dog"

      Taking the above to an extreme (longer string) or if the database is slow can result in database connection exhaustion as for each character typed a GET request is made to /rest/api/latest/projects/<proj>/repos/<repo>/participants

      I've tested this on 7.14, but expect perhaps as far back as 7.0 would exhibit the same problem.

      Expected Results

      The participant selector is less prone to consume large numbers of database connections.

      Actual Results

      Large numbers of database connections are consumed. In the worse case connection exhaustion and:

      java.sql.SQLTransientConnectionException: bitbucket - Connection is not available, request timed out after 15000ms
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        Activity

          People

            mmcglynn Deez Nutz (Inactive)
            behumphreys Ben Humphreys
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: