Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating FunctionsNetHost (dotnet isolated worker) to 1.0.9 #10262

Merged
merged 11 commits into from
Jul 15, 2024
3 changes: 2 additions & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
- Ordered invocations are now the default (#10201)
- Skip worker description if none of the profile conditions are met (#9932)
- Fixed incorrect function count in the log message.(#10220)
- Updated dotnet-isolated worker to [1.0.9](https://github.com/Azure/azure-functions-dotnet-worker/pull/2552) (#10262)
- Fix race condition on startup with extension RPC endpoints not being available. (#10255)
- Adding a timeout when retrieving function metadata from metadata providers (#10219)
- Adding a timeout when retrieving function metadata from metadata providers (#10219)
2 changes: 1 addition & 1 deletion src/WebJobs.Script/WebJobs.Script.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.22.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.22.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" NoWarn="NU1701" />
<PackageReference Include="Microsoft.Azure.Functions.DotNetIsolatedNativeHost" Version="1.0.8" />
<PackageReference Include="Microsoft.Azure.Functions.DotNetIsolatedNativeHost" Version="1.0.9" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.41-11331" />
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="5.0.0-beta.2-11957" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ await TestHelpers.Await(() =>
// in class LanguageWorkerOptionsSetup.cs -> Configure()
// which is giving extra log lines for node worker
traces = traces.Where(t =>
!t.Message.Contains("Skipping WorkerConfig for language")
!t.Message.Contains("Skipping WorkerConfig for language") && !t.Message.Contains("Skipping WorkerConfig for stack")
).ToArray();

int expectedCount = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ public void LanguageWorkerOptions_Expected_ListOfConfigs(string workerRuntime)
{
testEnvironment.SetEnvironmentVariable(RpcWorkerConstants.FunctionWorkerRuntimeSettingName, workerRuntime);
}
else
{
// The dotnet-isolated worker only runs in placeholder mode. Setting the placeholder environment to 1 for the test.
testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsitePlaceholderMode, "1");
kshyju marked this conversation as resolved.
Show resolved Hide resolved
}

testProfileManager.Setup(pm => pm.LoadWorkerDescriptionFromProfiles(It.IsAny<RpcWorkerDescription>(), out It.Ref<RpcWorkerDescription>.IsAny))
.Callback((RpcWorkerDescription defaultDescription, out RpcWorkerDescription outDescription) =>
{
// dotnet-isolated worker config does not have "DefaultExecutablePath" in the parent level.So, we should set it from a profile.
if (defaultDescription.Language == "dotnet-isolated")
{
outDescription = new RpcWorkerDescription() { DefaultExecutablePath = "testPath", Language = "dotnet-isolated" };
}
else
{
// for other workers, we should return the default description as they have the "DefaultExecutablePath" in the parent level.
outDescription = defaultDescription;
}
});

LanguageWorkerOptionsSetup setup = new LanguageWorkerOptionsSetup(configuration, NullLoggerFactory.Instance, testEnvironment, testMetricLogger, testProfileManager.Object);
LanguageWorkerOptions options = new LanguageWorkerOptions();
Expand Down
1 change: 0 additions & 1 deletion test/WebJobs.Script.Tests/ScriptHostTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,6 @@ public async Task Initialize_LogsWarningForExplicitlySetHostId()

[Theory]
[InlineData("python", "main.py", "python", "python")]
[InlineData("dotnet-isolated", "app.dll", "dotnet-isolated", "dotnet-isolated")]
kshyju marked this conversation as resolved.
Show resolved Hide resolved
[InlineData("dotnet", "app.dll", "dotnet", DotNetScriptTypes.DotNetAssembly)]
[InlineData(null, "app.dll", "dotnet", DotNetScriptTypes.DotNetAssembly)] // if FUNCTIONS_WORKER_RUNTIME is missing, assume dotnet
public async Task Initialize_MissingWorkerRuntime_SetsCorrectRuntimeFromFunctionMetadata(string functionsWorkerRuntime, string scriptFile, string expectedMetricLanguage, string expectedMetadataLanguage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public void DefaultWorkerConfigs_Overrides_DefaultWorkerRuntimeVersion_AppSettin
var config = configBuilder.Build();
var scriptSettingsManager = new ScriptSettingsManager(config);
var testLogger = new TestLogger("test");
_testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsitePlaceholderMode, "1");
kshyju marked this conversation as resolved.
Show resolved Hide resolved
using (var variables = new TestScopedSettings(scriptSettingsManager, testEnvVariables))
{
var configFactory = new RpcWorkerConfigFactory(config, testLogger, _testSysRuntimeInfo, _testEnvironment, new TestMetricsLogger(), _testWorkerProfileManager);
Expand Down
Loading