-
Notifications
You must be signed in to change notification settings - Fork 442
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.
At ScriptHost
startup, the host requests for the worker to index the functions and send back the function metadata through WorkerFunctionMetadataProvider
.
-
New metadata provider:
WorkerFunctionMetadataProvider
communicates with the worker to get the function metadata. It also validates the received metadata before sending it back toFunctionMetadataManager
. -
FunctionMetadataManager.LoadFunctionMetadata
: now checks to see if worker can index or not. Based on this result, either a newWorkerFunctionMetadatProvider
is created or the DIHostFunctionMetadataProvider
is used. -
New GRPC message types:
FunctionsMetadataRequest
,FunctionMetadataResponses
FunctionsMetadataRequest
sends the function app directory to the worker.FunctionMetadataResponses
includes a list ofFunctionLoadRequest
messages and an overallStatusResult
attribute. Each of theseFunctionLoadRequest
messages contains the function ID and correspondingRpcFunctionMetadata
message. -
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 utility function
Utility.CanWorkerIndex(RpcWorkerConfig workerConfig, IEnvironment environment)
to check to see if the worker can index or not. It returns true if the feature flag is enabled and theworker.config.json
file states that the worker can index. Otherwise, it returns false.
- Pull the latest version of dev locally.
- Then, set the
AzureWebJobsFeatureFlags
environment variable to have this value:EnableWorkerIndexing
. - To set up the worker, follow these instructions.
- Set a
"workerIndexing" : "true"
property within the Python worker'sworker.config.json
file.
- 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]