Pages deployment uses `/tmp` which is causing "Errno::ENOSPC: No space left on device - copy_file_range"

Summary

With 17.6.0 pages deployments fail due to insufficient diskspace. This seems to happen because it is tried to copy huge temporary files (copies of artifacts.zip) to copy to /tmp which is a tmpfs and unsuitable for this kind of files.

I tried to set TMPDIR environment when starting puma + sidekiq. Or in gitlab.rb

gitlab_rails['env']['TMPDIR'] = "/srv/tmp"

Both methods did not work 😞

Steps to reproduce

Make /tmp a tmpfs with 256 MiB size and try to copy artificats > 1 GiB

What is the expected correct behavior?

Possible fixes

Unsetting the :ff_pages_use_open_file feature flag workarounds the problem for now.