Skip to content

Commit a352acb

Browse files
authored
Adding Additional logging before throwing WorkerConfig for runtime: {workerRunTime} not found (#8236)
* Adding logging when loading functions using custom providers(IFunctionProvider implementations). Also Added debug log entry to log all the * Moved the "reading functions" message inside AddMetadataFromCustomProviders
1 parent 363651f commit a352acb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/WebJobs.Script/Host/FunctionMetadataManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ private void LoadCustomProviderFunctions(List<FunctionMetadata> functionMetadata
207207

208208
private void AddMetadataFromCustomProviders(IEnumerable<IFunctionProvider> functionProviders, List<FunctionMetadata> functionMetadataList)
209209
{
210+
_logger.FunctionMetadataProviderParsingFunctions();
211+
210212
var functionProviderTasks = new List<Task<ImmutableArray<FunctionMetadata>>>();
211213
foreach (var functionProvider in functionProviders)
212214
{
@@ -218,6 +220,8 @@ private void AddMetadataFromCustomProviders(IEnumerable<IFunctionProvider> funct
218220
// This is used to make sure no duplicates are registered
219221
var distinctFunctionNames = new HashSet<string>(functionMetadataList.Select(m => m.Name));
220222

223+
_logger.FunctionMetadataProviderFunctionFound(functionMetadataListArray.Length);
224+
221225
foreach (var metadataArray in functionMetadataListArray)
222226
{
223227
if (!metadataArray.IsDefaultOrEmpty)

src/WebJobs.Script/Workers/Rpc/FunctionRegistration/RpcFunctionInvocationDispatcher.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ public async Task InitializeAsync(IEnumerable<FunctionMetadata> functions, Cance
233233
{
234234
// Only throw if workerConfig is null AND some functions have been found.
235235
// With .NET out-of-proc, worker config comes from functions.
236+
237+
var allLanguageNamesFromWorkerConfigs = string.Join(",", _workerConfigs.Select(c => c.Description.Language));
238+
_logger.LogDebug($"Languages present in WorkerConfig: {allLanguageNamesFromWorkerConfigs}");
239+
236240
throw new InvalidOperationException($"WorkerConfig for runtime: {_workerRuntime} not found");
237241
}
238242

0 commit comments

Comments
 (0)