Managed Dependencies: fixing cold start time regression #311
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.
When the ManagedDependencies folder contains leftovers from the previous PowerShell worker version, the new PowerShell worker may not be able to detect the correct snapshot to use. As a result, it installs a new snapshot on every PowerShell worker start, causing unnecessary "cold start" delays.
The problem is that the installed snapshot folders are expected to follow the
*rpattern, and some Az.* module names also match this pattern coincidentally (e.g. Az.TrafficManager). As a result, PowerShell worker mistakenly considersManagedDependencies/Az.TrafficManagerthe latest installed snapshot folder, tries to find theManagedDependencies/Az.TrafficManager/Az/2.5.0, assumes this snapshot is not good enough, and starts installing a new one.This change replaces the
*rpattern with*.r, which will filter out all the existing Az.* module folders, so that they don't interfere with looking for the latest snapshot anymore. These folders will be eventually purged from the storage.Until this change is deployed, the workaround for the issue is to stop the app, manually remove the content of the D:\home\data\ManagedDependencies folder, and start the app again.