diff --git a/release_notes.md b/release_notes.md index 6139d02073..f2f17c7f90 100644 --- a/release_notes.md +++ b/release_notes.md @@ -16,4 +16,5 @@ - This fixes a bug with worker indexing where we are shutting down worker channels and creating a new channel that never gets properly initialized as the invocation buffers are not created - this leads to a "Did not find initialized workers" error. - Check if a blob container or table exists before trying to create it (#9555) -- Limit dotnet-isolated specialization to 64 bit host process (#9548) \ No newline at end of file +- Limit dotnet-isolated specialization to 64 bit host process (#9548) +- Sending command line arguments to language workers with `functions-` prefix to prevent conflicts (#9514) \ No newline at end of file diff --git a/src/WebJobs.Script/WebJobs.Script.csproj b/src/WebJobs.Script/WebJobs.Script.csproj index f4edb6a779..a76dd6d946 100644 --- a/src/WebJobs.Script/WebJobs.Script.csproj +++ b/src/WebJobs.Script/WebJobs.Script.csproj @@ -1,4 +1,4 @@ - + Microsoft.Azure.WebJobs.Script @@ -47,7 +47,7 @@ - + diff --git a/src/WebJobs.Script/Workers/Rpc/RpcWorkerContext.cs b/src/WebJobs.Script/Workers/Rpc/RpcWorkerContext.cs index 50dd7d54ee..e39ce55adb 100644 --- a/src/WebJobs.Script/Workers/Rpc/RpcWorkerContext.cs +++ b/src/WebJobs.Script/Workers/Rpc/RpcWorkerContext.cs @@ -44,7 +44,10 @@ public RpcWorkerContext(string requestId, public override string GetFormattedArguments() { - return $" --host {ServerUri.Host} --port {ServerUri.Port} --workerId {WorkerId} --requestId {RequestId} --grpcMaxMessageLength {MaxMessageLength}"; + // Adding a second copy of the commandline arguments with the "functions-" prefix to prevent any conflicts caused by the existing generic names. + // Language workers are advised to use the "functions-" prefix ones and if not present fallback to existing ones. + + 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}"; } } } diff --git a/test/WebJobs.Script.Tests/Workers/DefaultWorkerProcessFactoryTests.cs b/test/WebJobs.Script.Tests/Workers/DefaultWorkerProcessFactoryTests.cs index 2286612603..5952481759 100644 --- a/test/WebJobs.Script.Tests/Workers/DefaultWorkerProcessFactoryTests.cs +++ b/test/WebJobs.Script.Tests/Workers/DefaultWorkerProcessFactoryTests.cs @@ -82,7 +82,7 @@ public void DefaultWorkerProcessFactory_Returns_ExpectedProcess(WorkerContext wo } if (workerContext is RpcWorkerContext) { - Assert.Equal(" httpvalue1 TestVal httpvalue2 --host localhost --port 80 --workerId testWorkerId --requestId testId --grpcMaxMessageLength 2147483647", childProcess.StartInfo.Arguments); + 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); } else {