Details
-
Bug
-
Resolution: Fixed
-
Low
-
8.0.7, 8.2.1, 8.1.6
-
None
-
2
-
Severity 3 - Minor
-
Description
Issue Summary
The Bamboo plan build summary page gets extremely slow when large commit messages are used on builds
This is reproducible on Data Center: Yes
Steps to Reproduce
- Create a plan and add a VCS repository to it
- Add test.txt
- Enable repository trigger
- Add some quiet period to the repository (I used 10 x 6)
- Run this script. It will commit a small file with a huge commit message many times in a short period of time
$ for i in {1..10} ; do for i in {1..5} ; do date > test.txt ; git commit -q -m "$(shuf -n 90000 /usr/share/dict/words | fmt -w 72)" test.txt ; sleep 1 ; done ; git push ; done
- Test Bamboo UI interaction whilst accessing the Build summary page and notice slowness
18 seconds do load the page
2022-05-12 22:35:14,793 INFO [https-jsse-nio-45821-exec-3] [AccessLogFilter] ealvarenga GET https://bamboo821.mydomain.net/chain/viewChain.action?planKey=GB-GB 1375658kb (...) 2022-05-12 22:35:43,244 DEBUG [https-jsse-nio-45821-exec-29] [AccessLogFilter] END: 200 ealvarenga GET https://bamboo821.mydomain.net/ajax/planStatusHistoryNeighbouringSummaries.action?planKey=GB-GB&_=1652358839372 1540260kb-448509kb 18165ms
Expected Results
The page should load within an acceptable period of time (a few seconds only). Large commit messages should be suppressed/trimmed when retrieved and shown on the UI.
Actual Results
The page load is very slow. Browser locks up when hovering the mouse over "Change by" whilst accessing "<Bamboo_URL>/build/ajax/viewBuildCommits.action?buildKey=PROJ-KEY&buildNumber=16" due to the large results
Workaround
This will alter the database and modify commit messages on the USER_COMMIT table. This workaround will only change the Bamboo Database. It will not modify the original commits stored on the Repository. Make sure to have a full backup of your Bamboo DB and <bamboo_home> and <bamboo_install> folders before attempting any changes. The following instructions are for PostgreSQL. Queries may vary depending on your Database product.
- Build key used on this example = GB-GB. You need to replace it with your equivalent PROJ-PLAN key
- Select the large commit messages so you know what commits are impacting your system
SELECT BRS.BUILD_KEY, Length(UC.COMMIT_COMMENT_CLOB), Substring(UC.COMMIT_COMMENT_CLOB FROM 0 FOR 50) commit_comment_clob, UC.COMMIT_ID, UC.REPOSITORY_CHANGESET_ID, UC.AUTHOR_ID, UC.COMMIT_DATE, UC.COMMIT_REVISION FROM USER_COMMIT UC JOIN REPOSITORY_CHANGESET RS ON RS.REPOSITORY_CHANGESET_ID = UC.REPOSITORY_CHANGESET_ID JOIN BUILDRESULTSUMMARY BRS ON BRS.BUILDRESULTSUMMARY_ID = RS.BUILDRESULTSUMMARY_ID WHERE BRS.BUILD_KEY LIKE 'GB-GB%' ORDER BY Length(UC.COMMIT_COMMENT_CLOB) DESC
- Add a temporary table that will be used as the new commit message. In this case, I am keeping the first 1000 characters of the commit message by using the PostgreSQL Substring function. Users can choose to remove even more (or less) characters by adjusting the Substring function call, or simply add a static text or even an empty string
CREATE TEMPORARY TABLE TEMP_UC_LARGER_THAN_1000_CHARS AS (SELECT BRS.BUILD_KEY, Substring(UC.COMMIT_COMMENT_CLOB FROM 0 FOR 1000) COMMIT_COMMENT_CLOB, UC.COMMIT_ID FROM USER_COMMIT UC JOIN REPOSITORY_CHANGESET RS ON RS.REPOSITORY_CHANGESET_ID = UC.REPOSITORY_CHANGESET_ID JOIN BUILDRESULTSUMMARY BRS ON BRS.BUILDRESULTSUMMARY_ID = RS.BUILDRESULTSUMMARY_ID WHERE Length(COMMIT_COMMENT_CLOB) > 1000 AND BRS.BUILD_KEY LIKE 'GB-GB%')
- Check the results in the temporary table and visualise the new suggested commit messages
SELECT * FROM TEMP_UC_LARGER_THAN_1000_CHARS
- Update the USER_COMMIT table with the updated commit messages
UPDATE USER_COMMIT SET COMMIT_COMMENT_CLOB = TEMP_UC_1000.COMMIT_COMMENT_CLOB FROM TEMP_UC_LARGER_THAN_1000_CHARS TEMP_UC_1000 WHERE TEMP_UC_1000.COMMIT_ID = USER_COMMIT.COMMIT_ID
- Drop the temporary table
DROP TABLE TEMP_UC_LARGER_THAN_1000_CHARS
- Validate the Bamboo UI and confirm the responsiveness of the build results page loading