Fix: add pollingInterval judgment
What does this MR do and why?
When the merged results pipelines and merge trains are enabled, accessing any MR page will result in frequent calls to the readyToMergeEE GraphQL API, with the frequency increasing over time.
Because we are not correctly verifying whether a timer has already been created. After each request completion callback, a timer is created which periodically makes requests to the interface. However, in each subsequent callback, another timer is created and a new request is made, causing an infinite loop. This results in an ever-increasing number of requests that are sent at an accelerated rate, resembling a DDOS attack.
This mr is used to fix this.
related issue: #396256 (closed)
related JH issue : https://jihulab.com/gitlab-cn/gitlab/-/issues/2660
/cc @iamphill @mtan-gitlab @JeremyWuuuuu
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
1678382158056 | 1678445520146 |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Using self-managed as an example:
- Navigate to the Settings -> Merge requests of any project.
- Find and open the
Enable merged results pipelines
toggle, as well as the Enable merge trains toggle underneath it. - Access any MR page within the project.
- Observe the network requests(focus on MR page).
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.