summaryrefslogtreecommitdiff
path: root/changelogs
diff options
context:
space:
mode:
authorPatrick Bajao <ebajao@gitlab.com>2019-08-09 18:09:06 +0800
committerPatrick Bajao <ebajao@gitlab.com>2019-08-09 18:09:06 +0800
commitd96c24d81590dd6da237f131d4c074b70e64e030 (patch)
tree89acd70b24f5256f495fc2ac2bdaeda071cac4b5 /changelogs
parent136c3efe61f2bee4acb9474d6a214a23632988ff (diff)
downloadgitlab-ce-d96c24d81590dd6da237f131d4c074b70e64e030.tar.gz
Invalidate branches cache on PostReceive
Whenever `PostReceive` is enqueued, `UpdateMergeRequestsWorker` is enqueued and `MergeRequests::RefreshService` is called, it'll check if the source branch of each MR asssociated to the push exists or not via `MergeRequest#source_branch_exists?`. The said method will call `Repository#branch_exists?` which is cached in `Rails.cache`. When the cache contains outdated data and the source branch actually exists, the `MergeRequests#RefreshService` job will close associated MRs which is not correct. The fix is to expire the branches cache of the project so we have updated data during the post receive hook which will help in the accuracy of the check if we need to close associated MRs or not.
Diffstat (limited to 'changelogs')
-rw-r--r--changelogs/unreleased/65803-invalidate-branches-cache-on-refresh.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/65803-invalidate-branches-cache-on-refresh.yml b/changelogs/unreleased/65803-invalidate-branches-cache-on-refresh.yml
new file mode 100644
index 00000000000..217db8aa05a
--- /dev/null
+++ b/changelogs/unreleased/65803-invalidate-branches-cache-on-refresh.yml
@@ -0,0 +1,5 @@
+---
+title: Invalidate branches cache on PostReceive
+merge_request: 31653
+author:
+type: fixed