-
Notifications
You must be signed in to change notification settings - Fork 453
Worker Indexing Changes
The goal of Project Stein is to shift the functions indexing responsibility from the host to the worker. Some changes were made to the host to enable this new role, so this wiki page will go over the details of what changes were made and why they were necessary.
![Original Host Flow](https://user-images.githubusercontent.com/44328061/125210548-6d1f9b80-e26e-11eb-9858-51d14b7d9d3e.png)
At ScriptHost
startup, the host requests for the worker to index the functions and send back the function metadata through WorkerFunctionMetadataProvider
.
![Worker Indexing Host Flow](https://user-images.githubusercontent.com/44328061/126363750-48984a44-5e23-41c1-9261-d088a04e55bc.png)
-
New metadata provider:
WorkerFunctionMetadataProvider
communicates with the worker to get the function metadata. It also validates the received metadata before sending it back toFunctionMetadataManager
-
New metadata provider factory:
FunctionMetadataProviderFactory
was created to provide a specific metadata provider toFunctionMetadataManager
depending on if the host was indexing or if the worker was indexing. Also, to make the distinction between each type of metadata provider more clear, the originalFunctionMetadataProvider.cs
file was renamed toHostFunctionMetadataProvider
. -
Edited
FunctionMetadataManager
constructor: added the metadata provider factory to the constructor for later use inLoadFunctionMetadata
(getting the appropriate provider and callingGetFunctionMetadata
on it). -
New GRPC message types:
WorkerFunctionMetadataRequest
,WorkerFunctionMetadataResponse
,WorkerFunctionMetadata
WorkerFunctionMetadataRequest
sends the function app directory to the worker.WorkerFunctionMetadataResponse
includes a list ofWorkerFunctionMetadata
messages and an overallStatusResult
attribute.WorkerFunctionMetadata
includes all information necessary to populateFunctionMetadata
and convey the indexing status for each function (ie. success, failure, etc.). Each of these messages corresponds to a single function. -
Added new initialization code path to
RpcFunctionInvocationDispatcher
: new functions break up the originalInitializeAsync
logic to allow the host to send theWorkerMetadataRequest
in the middle of the channel initialization process. The logic also needed to be broken up because the invocation buffers and invocation requests can only be made once the host has metadata to operate with. -
Added feature flag,
FeatureFlagEnableWorkerIndexing
, in front of new worker indexing code path -
Added
WorkerCapabilities
service to store capabilities for each worker runtime in a central structure. Every time a new worker channel sends its capabilities to the host, we update the _workerCapabilities structure inWorkerCapabilities
that can later be queried throughGetCapabilityValue(runtimeLanguage, capabilityName)
- Configuration Settings
- function.json
- host.json
- host.json (v2)
- Http Functions
- Function Runtime Versioning
- Official Functions developers guide
- Host Health Monitor
- Managing Connections
- Renaming a Function
- Retrieving information about the currently running function
- Site Extension Resolution
- Linux Consumption Regions
- Using LinuxFxVersion for Linux Function apps
- Out-of-proc Cancellation Tokens
- Assembly Resolution in Azure Functions
- ILogger
- Precompiled functions
- Official Functions C# developer reference
- Contributor Onboarding
- Development Process
- Deploying the Functions runtime as a private site extension
- Authoring & Testing Language Extensions
- Bindings in out-of-proc
- Language Extensibility
- Worker Capabilities
- Investigating and reporting issues with timer triggered functions not firing
- Sharing Your Function App name privately
- Azure Functions CLI release notes [moved here]
- Function App Zipped Deployment [deprecated]