Skip to content

Failures when auto-upgrading managed dependencies concurrently #252

@AnatoliB

Description

@AnatoliB

Two or more PowerShell workers may decide to auto-upgrade managed dependencies on the same Function app around the same time. As a result, they will be invoking Save-Module from different processes concurrently with the same target file system path. The problem is that Save-Module is not designed to handle this situation well:

  • Some workers get warnings like "Access to the path ... is denied", often followed by a ProviderFailToDownloadFile error that terminates saving modules. This one could be mitigated by retries with random back-offs.
  • Some workers do not get any failure indication from Save-Module, but the download process is not actually finished: some files are missing. This one is much worse as there is no easy way to detect that a retry is even needed.

Consider avoiding these issues by serializing auto-upgrade across all workers in the function app (use a file with a timestamp, a blob lease, etc. - TBD).

Alternatively, Save-Module could be fixed to handle concurrent invocations, or the PowerShell worker could install modules without using Save-Module, but these solutions look quite complicated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions