Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition leads the host to initialize placeholder (warmup) function in Linux environments #10725

Open
fabiocav opened this issue Jan 8, 2025 · 0 comments
Assignees

Comments

@fabiocav
Copy link
Member

fabiocav commented Jan 8, 2025

On Linux environments, a race condition may lead the host to initialize placeholder (warmup) function.

Repro steps

  • Deploy a function app in Flex Consumption with a worker that will fail initialization (e.g., crash at startup)

  • The platform will restart the host. During the restart, the LinuxInstanceManager.StartAssignment logic runs, which pushes site assignment to a background task (see the line of code here).

  • Because this assignment call is “fire and forget,” the environment variable indicating the host is no longer in placeholder mode sometimes isn’t set before the host initialization proceeds.

  • The host detects placeholder mode environment settings and incorrectly indexes the placeholder (warmup) function.

Expected behavior

The host should wait for the assignment to complete before initializing the JobHost so placeholder information (as well as application settings) is correctly applied. As a result, it should not index the placeholder/warmup function if the assignment step has actually completed.

Actual behavior

Due to the race condition, the host sometimes sees the environment as still in placeholder mode because the assignment logic hasn’t finished setting the appropriate environment variables. This leads the host to index the placeholder function incorrectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants