Azure / Azure/azure-functions-host

Placeholder is assigned to an app before worker is initialized

Open
#9,958 0 comments 0 reactions 0 assignees View on GitHub
needs-investigation
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

Created for [this incident](https://portal.microsofticm.com/imp/v3/incidents/details/484018781/home) (internal-only link). This appears to be a rare edge case. For this particular app, it only happened once in the last 90 days.

We see a Node.js worker starting on a placeholder template site, but rather than getting the WorkerInitRequest while still assigned to the placeholder app, the worker gets both a WorkerInitRequest and a FunctionEnvironmentReloadRequest while assigned to the actual customer app. The Node.js worker didn't handle this well. I filed [an issue](https://github.com/Azure/azure-functions-nodejs-worker/issues/737) on the Node.js side of things as well, but I don't think the host (or whoever) should be using a placeholder site for a user's site until after worker init has finished.

Here's a very pared down version of the logs, see the incident for an actual query:

| PreciseTimeStamp | AppName | Summary |
| --- | --- | --- |
|2024-02-14T10:17:15.2232391Z | functionsv4x64placeholdertemplatesite | Initiating Worker Process start up |
|2024-02-14T10:17:15.2251832Z | functionsv4x64placeholdertemplatesite | Starting worker process with FileName:node ... |
|2024-02-14T10:17:15.310154Z | <customer app> | node process with Id=4976 started |
|2024-02-14T10:17:16.7860431Z | <customer app> | Worker Process started. Received StartStream message |
|2024-02-14T10:17:16.8283348Z | <customer app> | Worker be917f1c-3ae1-4142-ac5d-29e7597e1678 received WorkerInitRequest |
|2024-02-14T10:17:17.2637967Z | <customer app> | Received WorkerInitResponse. Worker process initialized |
|2024-02-14T10:17:17.2721214Z | <customer app> | Sending FunctionEnvironmentReloadRequest to WorkerProcess with Pid: '4976' |
|2024-02-14T10:17:17.3279711Z | <customer app> | Received FunctionEnvironmentReloadResponse from WorkerProcess with Pid: '4976' |

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the incident details and the linked Node.js worker issue, since no source files, tests, or entry points are named here. Trace how placeholder app assignment overlaps WorkerInitRequest and FunctionEnvironmentReloadRequest, then verify that a customer app is not assigned before worker initialization completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, node.js
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.