Improve merge request creation response time by performing more tasks asynchronously [RUN ALL RSPEC] [RUN AS-IF-FOSS]
What does this MR do?
Moves some merge request "after create" tasks to be performed asynchronously.
The MergeRequests::AfterCreateService was created in order to move one problematic bit of code into an async job. It was noticed that these items could probably be moved as well. That work was deferred to a follow up issue to avoid slowing iteration. Since GitLab.com is currently suffering from performance issues, this is now a priority.
Locally, the performance bar reports for pg:
- Before: 397ms/111 queries
- After: 140ms/84 queries
The timing and number of queries vary, but there is definitely some improvement.
This touches FOSS only. I'll look at moving EE items after this.
Related to #208812 (closed)
Related to #325672 (closed)
Related to #20801 (closed)
TODO
-
Remove query whitelisting which allows this endpoint to run over 100 queries
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by Michael Kozono