Details
-
Bug
-
Resolution: Fixed
-
Medium
-
7.14.0
-
Severity 2 - Major
-
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
- Go to the Pull Request list page (/projects/<proj>/repos/<repo>/pull-requests)
- 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