Azure / Azure/azure-functions-host

X-MS-COLDSTART header not set in Flex

Open
#11,053 0 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
Needs: Triage (Functions)
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

I’ve noticed a different behavior in Flex with respect to how we detect cold start compared to Windows Consumption. When testing with Windows Consumption, I see the X-MS-COLDSTART header in the request, but in Flex, this header isn’t set.
I typically add a [tag](https://github.com/Azure/azure-functions-host/blob/4f319dd75733fea1cdbec2d9d163435568604575/src/WebJobs.Script.WebHost/Features/FunctionExecutionFeature.cs#L65) if the request is a cold start, but since the header is missing, request.IsColdStart() returns false. This also means we will miss this [log](https://github.com/Azure/azure-functions-host/blob/4f319dd75733fea1cdbec2d9d163435568604575/src/WebJobs.Script.WebHost/Features/FunctionExecutionFeature.cs#L91) as coldStartData will be null.

The header is windows only and is set by MinIYarp on the worker.

Proposal: Set the header during specialization.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.