-
Notifications
You must be signed in to change notification settings - Fork 461
Address LanguageWorkerOptions null in FunctionMetadataManager #10550
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
liliankasem
previously approved these changes
Oct 21, 2024
Was testing this further and I am seeing an actual discrepancy between the worker configs between WebHost and ScriptHost, will need to investigate that further. |
Blocked on #10369 |
kshyju
reviewed
Mar 5, 2025
kshyju
reviewed
Apr 2, 2025
kshyju
reviewed
Apr 2, 2025
kshyju
previously approved these changes
Apr 2, 2025
kshyju
previously approved these changes
Apr 3, 2025
91f8a88
to
5006dc9
Compare
kshyju
approved these changes
Apr 3, 2025
surgupta-msft
approved these changes
Apr 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue describing the changes in this PR
resolves #9859
Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-proc
branch to be included in Core Tools and non-Flex deployments.in-proc
branch is not requiredrelease_notes.md
Additional information
This PR reverts a portion of #9264 and uses a different approach to solve stale function metadata. This alternative approach also addresses the null-ref from #9859.
Background
#9264 set out to solve function metadata being calculated and cached with a stale set of worker configs. To address this, the PR allowed for worker configs to be explicitly supplied to the
GetFunctionMetadata
method. When configs were not explicitly supplied, it would get 'fallback' configs from the current service provider. However, that provider is the active host. If this was called too early in the hosts lifetime, the active host would benull
(leading to the null-ref).Examining the issue it is a cache invalidation problem.
GetFunctionMetadata
will get the current value ofLanguageWorkerOptions
, then build and cache the function metadata results. That caching is the problem, as language worker options changes over the lifetime of the functions host.Fix
To address the null ref and after taking a closer look at the root issue, a new approach has been taken. Instead of explicitly supplying the RPC configs (which all 2 instances of that were from the current value of
LanguageWorkerOptions
), we go back to the original approach of getting the current value of those options. With one major difference: we now subscribe to theOnChange
of those options and will invalidate the cache whenever they change. The next call toGetFunctionMetadata
will then re-build and cache the function metadata set.Additional Information
#9264 would get the
LanguageWorkerOptions
from the job host. This PR now gets them from the script host (parent of job host). These options are identical between the two hosts. PR #10369 even sets out to make the job hosts copy of these options a direct forwarding of the script hosts copy.