diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-25 14:47:17 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-25 15:06:38 -0700 |
commit | d4c87d4dd7a1d7e4d9b38d37b16c85f7326321fc (patch) | |
tree | 7602e6ae05f59d2c2b608ec48242253b71515b6a /app | |
parent | 76889a9956e76e300edc8993048c3cd5c3a24da0 (diff) | |
download | gitlab-ce-d4c87d4dd7a1d7e4d9b38d37b16c85f7326321fc.tar.gz |
Disable Rails SQL query cache when applying service templatessh-service-template-bug
When the SQL query cache is active, the SELECT query for finding
projects to apply service templates returns the same values. This causes
an infinite loop because even though bulk INSERT queries are made, the
cached results never reflect that progress. To fix this, we call
`Project.uncached` around the query to ensure new data is retrieved.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63595
Diffstat (limited to 'app')
-rw-r--r-- | app/services/projects/propagate_service_template.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/projects/propagate_service_template.rb b/app/services/projects/propagate_service_template.rb index a2f36d2bd1b..a25c985585b 100644 --- a/app/services/projects/propagate_service_template.rb +++ b/app/services/projects/propagate_service_template.rb @@ -24,7 +24,7 @@ module Projects def propagate_projects_with_template loop do - batch = project_ids_batch + batch = Project.uncached { project_ids_batch } bulk_create_from_template(batch) unless batch.empty? |