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

Fallback behavior to ensure in-proc payload compatibility with dotnet-isolated as the FUNCTIONS_WORKER_RUNTIME value #10439

Merged
merged 12 commits into from
Sep 3, 2024

Conversation

kshyju
Copy link
Member

@kshyju kshyju commented Aug 28, 2024

This update addresses the issue of running a function app where the FUNCTIONS_WORKER_RUNTIME setting does not match the function metadata from the deployed code. For example, if a function app is configured with "dotnet-isolated" as the FUNCTIONS_WORKER_RUNTIME but has an in-process (in-proc) app payload deployed, this scenario previously worked in version 4.34.

However, in version 4.35, a change was introduced (see this PR) that restricts the use of the dotnet-isolated worker configuration to only when the app is running in placeholder mode. This change was intentional to ensure that FunctionsNetHost starts only in placeholder mode. However, it inadvertently caused issues for incorrectly configured apps (i.e., those with an in-proc payload and a "dotnet-isolated" FUNCTIONS_WORKER_RUNTIME value), as this new behavior prevents the creation of the worker configuration instance, thereby stopping the function app from running.

This PR includes changes to temporarily support this use case while also emitting a diagnostic warning to customers. The intention is to remove this support in a future release.

Why it works in 4.34

The reason it works in 4.34 is we update the "Language" property of function metadata to "dotnet-isolated" (the language present in the workerconfig instance). Code here and here). Having this change (Language in function metadata entries matching with FUNCTIONS_WORKER_RUNTIME
) and having at least one workerconfig instance to match the worker runtime value (dotnet-isolated) make things works.

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • [x ] Otherwise: Backport tracked by issue/PR #issue_or_pr - will follow
  • My changes do not require diagnostic events changes
    • Otherwise: Added diag event. will work on docs change.
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Additional PR information

@kshyju kshyju requested a review from a team as a code owner August 28, 2024 23:29
@kshyju kshyju force-pushed the shkr/handle_dotnet_worker_channel branch from 1bd8f81 to 5ecb2e7 Compare August 29, 2024 17:25
src/WebJobs.Script/Host/ScriptHost.cs Show resolved Hide resolved
src/WebJobs.Script/Host/ScriptHost.cs Outdated Show resolved Hide resolved
src/WebJobs.Script/Host/ScriptHost.cs Outdated Show resolved Hide resolved
src/WebJobs.Script/Utility.cs Outdated Show resolved Hide resolved
src/WebJobs.Script/Host/ScriptHost.cs Show resolved Hide resolved
release_notes.md Outdated Show resolved Hide resolved
@kshyju kshyju force-pushed the shkr/handle_dotnet_worker_channel branch from 8efc5bc to bf3f611 Compare August 29, 2024 20:18
@kshyju kshyju changed the title Fallback behavior when FUNCTIONS_WORKER_RUNTIME does not match with metadata from app payload Fallback behavior to ensure in-proc payload compatibility with dotnet-isolated as the FUNCTIONS_WORKER_RUNTIME value Aug 29, 2024
@kshyju kshyju merged commit c006a08 into dev Sep 3, 2024
10 checks passed
@kshyju kshyju deleted the shkr/handle_dotnet_worker_channel branch September 3, 2024 18:44
kshyju added a commit that referenced this pull request Sep 4, 2024
…t-isolated` as the `FUNCTIONS_WORKER_RUNTIME` value (#10439)

* Adding diagnostic warning/error when function worker runtime does not match with deployed payload

* Making the new condition specific to "dotnet-isolated" worker to reduce impact.

* Adding a test

* PR feedback fixes

* Missed release notes in last push

* Removed an unnecessary code change.

* Minor cleanup

* Minor cleanup- made a method private and vairable renaming

* Updating HostingConfig test to reflect the new hosting config property addition.

* PR Feedback updates.

* Fix test to reflect renaming changes from PR feedback.
kshyju added a commit that referenced this pull request Sep 4, 2024
…t-isolated` as the `FUNCTIONS_WORKER_RUNTIME` value (#10439) (#10449)

* Adding diagnostic warning/error when function worker runtime does not match with deployed payload

* Making the new condition specific to "dotnet-isolated" worker to reduce impact.

* Adding a test

* PR feedback fixes

* Missed release notes in last push

* Removed an unnecessary code change.

* Minor cleanup

* Minor cleanup- made a method private and vairable renaming

* Updating HostingConfig test to reflect the new hosting config property addition.

* PR Feedback updates.

* Fix test to reflect renaming changes from PR feedback.
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

Successfully merging this pull request may close these issues.

6 participants