-
Notifications
You must be signed in to change notification settings - Fork 469
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:
WorkerFunctionMetadataProvidercommunicates 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 newWorkerFunctionMetadatProvideris created or the DIHostFunctionMetadataProvideris used. -
New GRPC message types:
FunctionsMetadataRequest,FunctionMetadataResponsesFunctionsMetadataRequestsends the function app directory to the worker.FunctionMetadataResponsesincludes a list ofFunctionLoadRequestmessages and an overallStatusResultattribute. Each of theseFunctionLoadRequestmessages contains the function ID and correspondingRpcFunctionMetadatamessage. -
Added new initialization code path to
RpcFunctionInvocationDispatcher: new functions break up the originalInitializeAsynclogic to allow the host to send theWorkerMetadataRequestin 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.jsonfile states that the worker can index. Otherwise, it returns false.
- Pull the latest version of dev locally.
- Then, set the
AzureWebJobsFeatureFlagsenvironment 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.jsonfile.
- 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]