[eng/common] Helper function "Install-ModuleIfNotInstalled" is not threadsafe #6514
Labels
EngSys
This issue is impacting the engineering system.
needs-triage
Workflow: This is a new issue that needs to be triaged to the appropriate team.
In pipeline "Autorest Regen Preview", the following command fails intermittently. I think this might be a race condition, where multiple parallel threads (39 and 40) are installing the same module at the same time, and it's possible for one thread to see a partial install.
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=2906603&view=logs&j=a59e8b2b-145b-5c08-bac3-c8d41476a686&t=b360b5d6-342a-59db-d57c-25f0340a37f5&l=4073
I suspect the root cause is one of the
Install-ModuleIfNotInstalled
commands inazure-sdk-for-net
:https://github.com/search?q=repo%3AAzure%2Fazure-sdk-for-net%20powershell-yaml&type=code
One level deeper, I believe the root cause is using
Install-Module -Force
, which can overwrite the module and cause a parallelImport-Module
to fail.https://github.com/Azure/azure-sdk-for-net/blob/3ab9a7ac57f8a7672079c1ffba1ad8f95cfa5a1b/eng/common/scripts/Helpers/PSModule-Helpers.ps1#L86
The text was updated successfully, but these errors were encountered: