Create shadow file systems in configured LocalTempPath #15637
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
When Umbraco Deploy creates a scope to process a deployment (e.g. content transfers or restores between environments), it enables scoped file systems, so any changes to files are only applied when the scope successfully completes. This is done by creating 'shadow' file systems, which track all changes and stores the files in a temporary directory.
We received some support tickets from customers that got the following exception during these deployments:
System.IO.IOException: There is not enough space on the disk. : 'C:\home\site\wwwroot\umbraco\Data\TEMP\ShadowFs\dzpd2b0c\media\[...]
. This can happen if they are trying to deploy a large amount and/or very big media files between environments, which exceeds the free/allowed disk space on the server.I noticed the path was using the persistent storage directory on Umbraco Cloud (Azure App Service), even though
Umbraco:CMS:Hosting:LocalTempStorageLocation
is set toEnvironmentTemp
. This location has limited disk space and is also slower compared to using the local temporary storage. This PR should therefore make deployments faster and at the same time allow for more/larger files to be deployed.To test the changes, add the following composer and start the debugger. Once the debugger breaks, check whether the test folder/directory is created in the correct
ShadowFs
directory, in either the environment temp or default location (depending on the configuredLocalTempStorageLocation
):