Skip to content

Fixed: init-permissions takes too long for windows volumes

What does this MR do?

Fixed: init-permissions takes too long for windows volumes (#36829)

Why was this MR needed?

When you use a persistent volume for the build area with the Kubernetes executor, the init-permissions container takes a long time for Windows volumes. It uses icacls.exe to recursively set permissions on all files that exist on the volume. Setting Access Control Lists for a large number of files is a slow operation on Windows. For large projects the operation takes 10 minutes and times out, might take hours to actually finish.

Solution: Do not run icacls.exe with recursion (/t). We already set all new files to inherit permissions from the root folder. So all files that are created later from the root up will work fine. There is no compelling reason to use a volume that contains files with stricter permissions, at least in paths that the CI job needs to access. The user should have no trouble setting up the permissions in the volume properly ahead of time, instead of us doing the slow operation in every single job.

What's the best way to test this MR?

See #36829

What are the relevant issue numbers?

This is one of two alternative solutions to #36829. The other one is !4322 (closed), which adds a new option for disabling the recursion. It's safer, but adding a new option is a cost.

Edited by OK_MF

Merge request reports