Skip to content

Commit f4fa1b1

Browse files
authored
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.
1 parent 8cd901e commit f4fa1b1

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

release_notes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
- This fixes a bug with worker indexing where we are shutting down worker channels and creating a new channel that never
1717
gets properly initialized as the invocation buffers are not created - this leads to a "Did not find initialized workers" error.
1818
- Check if a blob container or table exists before trying to create it (#9555)
19-
- Limit dotnet-isolated specialization to 64 bit host process (#9548)
19+
- Limit dotnet-isolated specialization to 64 bit host process (#9548)
20+
- Sending command line arguments to language workers with `functions-` prefix to prevent conflicts (#9514)

src/WebJobs.Script/WebJobs.Script.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\build\common.props" />
33
<PropertyGroup>
44
<PackageId>Microsoft.Azure.WebJobs.Script</PackageId>
@@ -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.0" />
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/RpcWorkerContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public RpcWorkerContext(string requestId,
4444

4545
public override string GetFormattedArguments()
4646
{
47-
return $" --host {ServerUri.Host} --port {ServerUri.Port} --workerId {WorkerId} --requestId {RequestId} --grpcMaxMessageLength {MaxMessageLength}";
47+
// Adding a second copy of the commandline arguments with the "functions-" prefix to prevent any conflicts caused by the existing generic names.
48+
// Language workers are advised to use the "functions-" prefix ones and if not present fallback to existing ones.
49+
50+
return $" --host {ServerUri.Host} --port {ServerUri.Port} --workerId {WorkerId} --requestId {RequestId} --grpcMaxMessageLength {MaxMessageLength} --functions-uri {ServerUri.AbsoluteUri} --functions-worker-id {WorkerId} --functions-request-id {RequestId} --functions-grpc-max-message-length {MaxMessageLength}";
4851
}
4952
}
5053
}

test/WebJobs.Script.Tests/Workers/DefaultWorkerProcessFactoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void DefaultWorkerProcessFactory_Returns_ExpectedProcess(WorkerContext wo
8282
}
8383
if (workerContext is RpcWorkerContext)
8484
{
85-
Assert.Equal(" httpvalue1 TestVal httpvalue2 --host localhost --port 80 --workerId testWorkerId --requestId testId --grpcMaxMessageLength 2147483647", childProcess.StartInfo.Arguments);
85+
Assert.Equal(" httpvalue1 TestVal httpvalue2 --host localhost --port 80 --workerId testWorkerId --requestId testId --grpcMaxMessageLength 2147483647 --functions-uri http://localhost/ --functions-worker-id testWorkerId --functions-request-id testId --functions-grpc-max-message-length 2147483647", childProcess.StartInfo.Arguments);
8686
}
8787
else
8888
{

0 commit comments

Comments
 (0)