Skip to content

Adjust refresh_storage_size! method

Mohamed Hamda requested to merge mhamda/project_statistics_race_condition into master

What does this MR do and why?

This MR resolves Potential race condition between ProjectStatistics #refresh!, #refresh_storage_size!, #update_counters_with_lease

As suggested in https://gitlab.com/gitlab-org/gitlab/-/issues/376420#note_1285669088 we can change to use after_commit

There are some extra changes here, due to update! firing the callback again, we better use update_collumns -> Discussion https://gitlab.com/gitlab-org/gitlab/-/issues/376420#note_1500472143

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports