Skip to content

Fix scope of project export download throttling

What does this MR do and why?

Fixes the issue of project export downloads not being throttled per group.

The project import/export documentation currently states that export downloads are limited to "1 download per group per minute". The current behavior however only throttles export downloads within the scope of one project.

The following table compares the current behavior and the proposed behavior for throttling project export downloads, assuming the requests are made back-to-back within the span of one minute.

Current New
user1/project1 Download Download
user1/project1 Throttled Throttled
user1/project2 Download Throttled
user2/project3 Download Download
user2/project4 Download Throttled
group1/project5 Download Download
group1/project6 Download Throttled
group1/subgroup/project7 Download Download
group1/subgroup/project8 Download Throttled
group2/project9 Download Download
group2/project10 Download Throttled

How to set up and validate locally

  1. Create exports of multiple different projects (e.g. two personal projects, two projects of group-1, two projects of group-2)
  2. Wait until all exports are ready for download
  3. Try to download all the exports back-to-back within the span of one minute
  4. Note that only the first download within a namespace succeeds, while others are throttled

Doing these steps on the current version would not result in any throttling at all, unless it gets tried to download one export twice.

MR acceptance checklist

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

Closes #323637 (closed)

Merge request reports