-
Notifications
You must be signed in to change notification settings - Fork 54
Description
Impact
If the first app deployment is followed by a rapid sequence of function invocations, some function invocations may not have the required modules available until all the workers restart. Background auto-upgrades after that are not impacted.
Root cause
In this situation, multiple PowerShell workers may start around the same time. By design, since there is no installed acceptable snapshot yet, each worker will start installing dependency snapshots independently. The first worker that finishes downloading its snapshot promotes it to an installed snapshot and becomes ready to handle function invocations. However, the next worker compares the snapshot it just downloaded with the latest installed snapshot and, if they are equivalent, removes its own snapshot.
The logic of removing equivalent snapshots is intentional, but it was meant to apply to background upgrades only. In the background upgrade case, the worker already has an acceptable snapshot assigned, so the newly downloaded snapshot can be safely removed. However, in the initial installation case, the worker cannot be reassigned to a different snapshot, so removing the downloaded snapshot means that the worker will not have any snapshot until restarted.
Workaround
Restart the app.