-
Notifications
You must be signed in to change notification settings - Fork 482
Open
Labels
Needs: Triage (Functions)compute-separationCompute separation / external worker supportCompute separation / external worker support
Description
Today, WorkerFunctionMetadataProvider calls IWebHostRpcWorkerChannelManager.InitializeChannelAsync() when no channels exist — that spawns a process. For external workers, we need a parallel implementation that waits for an inbound connection instead.
Dependencies: M2 (#11643)
Problem
ScriptHost.InitializeAsync() → GetFunctionsMetadata()
→ WorkerFunctionMetadataProvider.GetFunctionMetadataAsync()
→ _channelManager.GetChannels() — no channels!
→ _channelManager.InitializeChannelAsync() ← SPAWNS PROCESS
This happens before RpcFunctionInvocationDispatcher.InitializeAsync() runs, so the new ConnectedWorkerInvocationDispatcher alone doesn't prevent the process spawn.
Solution
New IWorkerFunctionMetadataProvider implementation swapped via DI:
IWorkerFunctionMetadataProvider
/ \
WorkerFunctionMetadataProvider ConnectedWorkerFunctionMetadataProvider
(existing — starts processes) (new — waits for inbound connection)
Acceptance Criteria
- Implements
IWorkerFunctionMetadataProvider - Blocks until external worker connects (2-minute timeout, matching
ScriptTypeLocator) - Returns validated metadata via standard
GetFunctionMetadata()RPC - Handles worker opt-out (
UseDefaultMetadataIndexing) - Caches results; returns cached on non-refresh calls
-
WorkerFunctionMetadataProvideris unchanged - Unit tests
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs: Triage (Functions)compute-separationCompute separation / external worker supportCompute separation / external worker support