Fix GEO cache pollution between different requests

What does this MR do and why?

Fix problem of cache pollution between different requests.

What

On the slave node, the clone URL displayed on project homepage occasionally shows the domain/IP of other slave nodes.

This problem seems to exist in all GEO clusters with multiple slave nodes. I'm surprised that there isn't an issue to report this problem. Jihu's customers have encountered this problem, and I have also reproduced it in my test environment.

Why

In the code for obtaining the clone URL, we used strong_memoize in the class method, which means the cache is at the process level and will be shared among different requests. This causes requests forwarded from different slave nodes to the master node to get the same clone URL result.

References

Screenshots or screen recordings

No UI changes.

How to set up and validate locally

  1. Build a GEO cluster with at least two slave nodes.
  2. On a slave node, open the homepage of any Project and view the clone URL. Before applying the changes of the current MR, the clone URL will occasionally display the domain/IP of other slave nodes.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Zhiyuan Lu

Merge request reports

Loading