You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a timeout to IFunctionProvider.GetFunctionMetadataAsync (#10249)
* Adding a timeout to IFunctionProvider.GetFunctionMetadataAsync so that if a provider does not return, it will not cause a deadlock state.
* Adding release notes.
* Added a new internal property `MetadataProviderTimeoutInSeconds` which can be set to a different value than default, from the tests.
* Added comment about property being settable.
* PR feedback fixes. Throws an error when the function metadata provider method throws or when the operation timeseout.
privateconststring_functionConfigurationErrorMessage="Unable to determine the primary function script.Make sure atleast one script file is present.Try renaming your entry point script to 'run' or alternatively you can specify the name of the entry point script explicitly by adding a 'scriptFile' property to your function metadata.";
25
-
privateconststring_metadataProviderName="Custom";
24
+
privateconststringFunctionConfigurationErrorMessage="Unable to determine the primary function script.Make sure atleast one script file is present.Try renaming your entry point script to 'run' or alternatively you can specify the name of the entry point script explicitly by adding a 'scriptFile' property to your function metadata.";
thrownewTimeoutException($"Timeout occurred while retrieving metadata from provider '{functionProvider.GetType().FullName}'. The operation exceeded the configured timeout of {MetadataProviderTimeoutInSeconds} seconds.");
Assert.Contains($"Timeout occurred while retrieving metadata from provider '{badFunctionMetadataProvider.Object.GetType().FullName}'. The operation exceeded the configured timeout of 1 seconds.",exception.Message);
263
+
264
+
vartraces=testLoggerProvider.GetAllLogMessages();
265
+
Assert.Single(traces, t =>t.FormattedMessage.Contains("Reading functions metadata (Custom)"));
266
+
Assert.DoesNotContain(traces, t =>t.FormattedMessage.Contains("2 functions found (Custom)"));
0 commit comments