Skip to content

Commit 70f7c44

Browse files
VpOfEngineeringazfuncghkshyjuFrancisco-Gaminoshreyas-gopalakrishna
committed
4.27.5 hotfix (#9609)
* Updating patch version * Sending command line args with functions- prefix to prevent conflicts (#9514) * Sending a second copy of command line args with "FUNCTIONS_" prefix * Cleanup * Sending a second copy of command line args with "FUNCTIONS_" prefix * switched to functions- prefix * Removed duplicate port from functions_uri * Switching to kebab case for the new args * Update test * Update native placeholder package to handle new args * Update release notes. * Limit dotnet-isolated specialization to 64 bit host process (#9553) * Skipping native placeholder specialization if host is not 64 bit process * formatting linting fix * Stylecop fix. * fix indentation * Adding E2E test. * Improving log message. * Switch from LogDebug to LogInformation * Fix tests to reflect logging changes * Logging with EventId * Logging using an event name * Updated release notes after rebase merge * Handling env reload response from native placeholder for failure case. (#9602) * Handling env reload response from native placeholder for failure case. * Almost working except one test needs cleanup * Cleanup * Cleanup * Fixing Worker.Extensions.Http package version to align with Http.AspNetCore package. * Logging error as it is received from the worker. * DotNetIsolatedNativeHost package to 1.0.2 * Inlining a variable (Reverting to previous version) * Updating release notes for 4.27.5 * Update PowerShell Language Workers 7.0 (to version 4.0.2973), 7.2 (to version 4.0.2974), and 7.4 (to version 4.0.2975) (#9528) * Upgrade PowerShell language worker 7.4 to 4.0.2975 * Upgrade PowerShell language worker 7.2 to 4.0.2974 * Upgrade PowerShell language worker 7.0 to 4.0.2973 * Update release notes * Update Java Worker Version to 2.13.0 (#9544) * Update Java Worker Version to 2.13.0 * Update release_notes.md for Java worker --------- Co-authored-by: AzureFunctionsJava <[email protected]> --------- Co-authored-by: azfuncgh <[email protected]> Co-authored-by: Shyju Krishnankutty <[email protected]> Co-authored-by: Francisco Gamino <[email protected]> Co-authored-by: Shreyas Gopalakrishna <[email protected]> Co-authored-by: AzureFunctionsJava <[email protected]>
1 parent 4d7e437 commit 70f7c44

File tree

18 files changed

+261
-55
lines changed

18 files changed

+261
-55
lines changed

release_notes.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
-->
66
- Update Python Worker Version to [4.20.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/4.20.0)
77
- Update Java Worker Version to [2.13.0](https://github.com/Azure/azure-functions-java-worker/releases/tag/2.13.0)
8-
- Update WebJobsScriptHostService to remove hardcoded sleep during application shut down (#9520)
8+
- Increased maximum HTTP request content size to 210000000 Bytes (~200MB)
9+
- Update Node.js Worker Version to [3.8.1](https://github.com/Azure/azure-functions-nodejs-worker/releases/tag/v3.8.1)
10+
- Update PowerShell 7.4 Worker Version to [4.0.2975](https://github.com/Azure/azure-functions-powershell-worker/releases/tag/v4.0.2975)
911
- Update PowerShell 7.2 Worker Version to [4.0.2974](https://github.com/Azure/azure-functions-powershell-worker/releases/tag/v4.0.2974)
1012
- Update PowerShell 7.0 Worker Version to [4.0.2973](https://github.com/Azure/azure-functions-powershell-worker/releases/tag/v4.0.2973)
11-
- Add support for standalone executable (ie: `dotnet build --standalone`) for out-of-proc workers in Linux Consumption. (#9550)
12-
- Bug fix: Do not restart worker channels or JobHost when an API request is made to get or update the function metadata (unless the config was changed) (#9510)
13-
- This fixes a bug where requests to 'admin/functions' lead to a "Did not find initialized workers" error when
14-
worker indexing is enabled.
15-
- Bug fix: If there are no channels created and the host is running, restart the JobHost instead of shutting down worker channels (#9510)
16-
- This fixes a bug with worker indexing where we are shutting down worker channels and creating a new channel that never
17-
gets properly initialized as the invocation buffers are not created - this leads to a "Did not find initialized workers" error.
18-
- Check if a blob container or table exists before trying to create it (#9555)
1913
- Limit dotnet-isolated specialization to 64 bit host process (#9548)
2014
- Sending command line arguments to language workers with `functions-` prefix to prevent conflicts (#9514)
15+
- Update WebJobsScriptHostService to remove hardcoded sleep during application shut down (#9520)

src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,18 @@ internal void FunctionEnvironmentReloadResponse(FunctionEnvironmentReloadRespons
374374

375375
ApplyCapabilities(res.Capabilities, res.CapabilitiesUpdateStrategy.ToGrpcCapabilitiesUpdateStrategy());
376376

377-
if (res.Result.IsFailure(out Exception reloadEnvironmentVariablesException))
377+
if (res.Result.IsFailure(IsUserCodeExceptionCapabilityEnabled(), out var reloadEnvironmentVariablesException))
378378
{
379-
_workerChannelLogger.LogError(reloadEnvironmentVariablesException, "Failed to reload environment variables");
380-
_reloadTask.SetException(reloadEnvironmentVariablesException);
379+
if (res.Result.Exception is not null && reloadEnvironmentVariablesException is not null)
380+
{
381+
_workerChannelLogger.LogWarning(reloadEnvironmentVariablesException, reloadEnvironmentVariablesException.Message);
382+
}
383+
_reloadTask.SetResult(false);
384+
}
385+
else
386+
{
387+
_reloadTask.SetResult(true);
381388
}
382-
_reloadTask.SetResult(true);
383389
latencyEvent.Dispose();
384390
}
385391

@@ -414,6 +420,15 @@ internal void WorkerInitResponse(GrpcEvent initEvent)
414420
_workerInitTask.TrySetResult(true);
415421
}
416422

423+
private bool IsUserCodeExceptionCapabilityEnabled()
424+
{
425+
var enableUserCodeExceptionCapability = string.Equals(
426+
_workerCapabilities.GetCapabilityState(RpcWorkerConstants.EnableUserCodeException), bool.TrueString,
427+
StringComparison.OrdinalIgnoreCase);
428+
429+
return enableUserCodeExceptionCapability;
430+
}
431+
417432
private void LogWorkerMetadata(WorkerMetadata workerMetadata)
418433
{
419434
if (workerMetadata == null)
@@ -546,7 +561,7 @@ internal FunctionLoadRequestCollection GetFunctionLoadRequestCollection(IEnumera
546561
return functionLoadRequestCollection;
547562
}
548563

549-
public Task SendFunctionEnvironmentReloadRequest()
564+
public Task<bool> SendFunctionEnvironmentReloadRequest()
550565
{
551566
_functionsIndexingTask = new TaskCompletionSource<List<RawFunctionMetadata>>(TaskCreationOptions.RunContinuationsAsynchronously);
552567
_functionMetadataRequestSent = false;
@@ -1584,4 +1599,4 @@ private void OnTimeout()
15841599
}
15851600
}
15861601
}
1587-
}
1602+
}

src/WebJobs.Script.Grpc/MessageExtensions/StatusResultExtensions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33

44
using System;
55
using System.Threading.Tasks;
6-
using Grpc.Core;
7-
using Microsoft.Azure.WebJobs.Script.Config;
86
using Microsoft.Azure.WebJobs.Script.Grpc.Messages;
97

108
namespace Microsoft.Azure.WebJobs.Script.Grpc
119
{
1210
internal static class StatusResultExtensions
1311
{
14-
public static bool IsFailure(this StatusResult statusResult, out Exception exception)
12+
public static bool IsFailure(this StatusResult statusResult, bool enableUserCodeExceptionCapability, out Exception exception)
1513
{
1614
switch (statusResult.Status)
1715
{
1816
case StatusResult.Types.Status.Failure:
19-
exception = GetRpcException(statusResult);
17+
exception = GetRpcException(statusResult, enableUserCodeExceptionCapability);
2018
return true;
2119

2220
case StatusResult.Types.Status.Cancelled:
@@ -29,6 +27,11 @@ public static bool IsFailure(this StatusResult statusResult, out Exception excep
2927
}
3028
}
3129

30+
public static bool IsFailure(this StatusResult statusResult, out Exception exception)
31+
{
32+
return IsFailure(statusResult, false, out exception);
33+
}
34+
3235
/// <summary>
3336
/// This method is only hit on the invocation code path.
3437
/// enableUserCodeExceptionCapability = feature flag exposed as a capability that is set by the worker.
@@ -68,4 +71,4 @@ public static Workers.Rpc.RpcException GetRpcException(StatusResult statusResult
6871
return new Workers.Rpc.RpcException(status, string.Empty, string.Empty);
6972
}
7073
}
71-
}
74+
}

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.21.0" />
4848
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.21.0" />
4949
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.21.0" />
50-
<PackageReference Include="Microsoft.Azure.Functions.DotNetIsolatedNativeHost" Version="1.0.0-preview805" />
50+
<PackageReference Include="Microsoft.Azure.Functions.DotNetIsolatedNativeHost" Version="1.0.2" />
5151
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.39" />
5252
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="5.0.0-beta.2-11957" />
5353
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.0" />

src/WebJobs.Script/Workers/Rpc/IRpcWorkerChannel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public interface IRpcWorkerChannel : IWorkerChannel
2222

2323
void SendFunctionLoadRequests(ManagedDependencyOptions managedDependencyOptions, TimeSpan? functionTimeout);
2424

25-
Task SendFunctionEnvironmentReloadRequest();
25+
Task<bool> SendFunctionEnvironmentReloadRequest();
2626

2727
void SendWorkerWarmupRequest();
2828

src/WebJobs.Script/Workers/Rpc/WebHostRpcWorkerChannelManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ public async Task SpecializeAsync()
123123

124124
if (_workerRuntime != null && rpcWorkerChannel != null)
125125
{
126+
bool envReloadRequestResultSuccessful = false;
126127
if (UsePlaceholderChannel(rpcWorkerChannel))
127128
{
128129
_logger.LogDebug("Loading environment variables for runtime: {runtime}", _workerRuntime);
129-
await rpcWorkerChannel.SendFunctionEnvironmentReloadRequest();
130+
envReloadRequestResultSuccessful = await rpcWorkerChannel.SendFunctionEnvironmentReloadRequest();
130131
}
131-
else
132+
133+
if (envReloadRequestResultSuccessful == false)
132134
{
133135
_logger.LogDebug("Shutting down placeholder worker. Worker is not compatible for runtime: {runtime}", _workerRuntime);
134136
// If we need to allow file edits, we should shutdown the webhost channel on specialization.

test/DotNetIsolated60/DotNetIsolated60.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<FunctionsEnableWorkerIndexing>True</FunctionsEnableWorkerIndexing>
9+
<FunctionsAutoRegisterGeneratedMetadataProvider>True</FunctionsAutoRegisterGeneratedMetadataProvider>
10+
<FunctionsEnableExecutorSourceGen>True</FunctionsEnableExecutorSourceGen>
911
</PropertyGroup>
1012
<ItemGroup>
11-
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.18.0" />
12-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
13-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.0.0-preview2" />
13+
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.19.0" />
14+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
15+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.0.0" />
1416
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="6.0.0" />
15-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.12.0" />
17+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.15.1" />
1618
</ItemGroup>
1719
<ItemGroup>
1820
<None Update="host.json">

test/DotNetIsolated60/DotNetIsolated60.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 17.5.33627.172
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetIsolated60", "DotNetIsolated60.csproj", "{1DA92227-F28E-408D-96B1-20C72571E4AE}"
77
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetIsolatedUnsupportedWorker", "..\DotNetIsolatedUnsupportedWorker\DotNetIsolatedUnsupportedWorker.csproj", "{3F15B936-6365-447E-9EC6-4E996B30C55F}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
1517
{1DA92227-F28E-408D-96B1-20C72571E4AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{1DA92227-F28E-408D-96B1-20C72571E4AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{1DA92227-F28E-408D-96B1-20C72571E4AE}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{3F15B936-6365-447E-9EC6-4E996B30C55F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{3F15B936-6365-447E-9EC6-4E996B30C55F}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{3F15B936-6365-447E-9EC6-4E996B30C55F}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{3F15B936-6365-447E-9EC6-4E996B30C55F}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

test/DotNetIsolated60/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
if (useProxy)
1212
{
1313
hostBuilder
14-
.ConfigureFunctionsWebApplication()
15-
.ConfigureGeneratedFunctionMetadataProvider();
14+
.ConfigureFunctionsWebApplication();
1615
}
1716
else
1817
{
1918
hostBuilder
20-
.ConfigureFunctionsWorkerDefaults()
21-
.ConfigureGeneratedFunctionMetadataProvider();
19+
.ConfigureFunctionsWorkerDefaults();
2220
}
2321

2422
var host = hostBuilder.Build();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net6.0</TargetFramework>
4+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
5+
<OutputType>Exe</OutputType>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<FunctionsEnableWorkerIndexing>True</FunctionsEnableWorkerIndexing>
9+
</PropertyGroup>
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.19.0" />
12+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
13+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.0.0" />
14+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="6.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.14.0" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<None Update="host.json">
19+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
20+
</None>
21+
<None Update="local.settings.json">
22+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
23+
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
24+
</None>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
28+
</ItemGroup>
29+
</Project>

0 commit comments

Comments
 (0)