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

Allow for an output binding value of an invocation result to be null #10698

Merged
merged 9 commits into from
Dec 19, 2024

Conversation

satvu
Copy link
Member

@satvu satvu commented Dec 13, 2024

Issue describing the changes in this PR

Part of the fix for Azure/azure-functions-dotnet-worker#2682, related to Azure/azure-functions-dotnet-worker#2896.

Allows for output binding values to be null, which is interpreted as the type ParameterBinding.None when receiving the values over gRPC.

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
    • Otherwise: Link to backporting PR
  • 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
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Here is the original PR adding the switch statement. The logic was originally added to differentiate between data transferred by the worker using shared memory vs RPC. It doesn't appear to purposefully prevent output bindings from having a null value.

Invocation results are nullable (see here), and the HTTP Proxying design sends a null result over the gRPC pipeline.

@satvu satvu changed the title Satvu/skip http output serialization Allow for an output binding value of an invocation result to be null Dec 13, 2024
@satvu satvu requested a review from jviau December 17, 2024 19:08
@satvu satvu marked this pull request as ready for review December 17, 2024 21:14
@satvu satvu requested a review from a team as a code owner December 17, 2024 21:14
@kshyju
Copy link
Member

kshyju commented Dec 18, 2024

Is this a breaking change for customers?

@satvu
Copy link
Member Author

satvu commented Dec 18, 2024

Is this a breaking change for customers?

I don't believe this will break existing customers explicitly. It will allow for a successful invocation to have an output binding with a null value. Without this change, the scenario would throw an exception.

I think that currently, cases where we can expect null output binding values are usually when invocations fail, and that is handled in a different code path starting from here.

This could definitely open the door for some new scenarios though. If a customer expects to have a value for their output binding but their function invocation status is "successful" despite an erroneous null value, this could break another one of their components.

@satvu satvu merged commit 1f1305f into dev Dec 19, 2024
9 checks passed
@satvu satvu deleted the satvu/skip-http-output-serialization branch December 19, 2024 22:15
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.

5 participants