Skip to content

Commit 6be6f3d

Browse files
surgupta-msftVpOfEngineeringfabiocavshreyas-gopalakrishna
authored
Hotfix for v4.3.1 - Revert - Adding ability to allow worker to send Function load response (#8348)
* 4.2.1 Hotfix - Change Java Worker Version Number (#8195) * Updating Integration/Test Projects * Release java worker 2.1.0-SNAPSHOT (#8191) * updating release notes * Update common.props Co-authored-by: Fabio Cavalcante <[email protected]> Co-authored-by: Shreyas Gopalakrishna <[email protected]> * Revert "Adding ability to allow worker to send Function load responses in batch (#8107)" (#8346) This reverts commit 8bae46f. * Upgrading minor version and patch version Co-authored-by: Jameson Z <[email protected]> Co-authored-by: Fabio Cavalcante <[email protected]> Co-authored-by: Shreyas Gopalakrishna <[email protected]>
1 parent 66fc485 commit 6be6f3d

File tree

4 files changed

+1
-74
lines changed

4 files changed

+1
-74
lines changed

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<LangVersion>latest</LangVersion>
66
<MajorVersion>4</MajorVersion>
77
<MinorVersion>3</MinorVersion>
8-
<PatchVersion>1</PatchVersion>
8+
<PatchVersion>2</PatchVersion>
99
<BuildNumber Condition="'$(BuildNumber)' == '' ">0</BuildNumber>
1010
<PreviewVersion></PreviewVersion>
1111

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -294,19 +294,11 @@ public void SendFunctionLoadRequests(ManagedDependencyOptions managedDependencyO
294294
.Timeout(_functionLoadTimeout)
295295
.Take(_functions.Count())
296296
.Subscribe((msg) => LoadResponse(msg.Message.FunctionLoadResponse), HandleWorkerFunctionLoadError));
297-
298-
_eventSubscriptions.Add(_inboundWorkerEvents.Where(msg => msg.MessageType == MsgType.FunctionLoadResponseCollection)
299-
.Timeout(_functionLoadTimeout)
300-
.Take(_functions.Count())
301-
.Subscribe((msg) => LoadResponse(msg.Message.FunctionLoadResponseCollection), HandleWorkerFunctionLoadError));
302297
}
303298
else
304299
{
305300
_eventSubscriptions.Add(_inboundWorkerEvents.Where(msg => msg.MessageType == MsgType.FunctionLoadResponse)
306301
.Subscribe((msg) => LoadResponse(msg.Message.FunctionLoadResponse), HandleWorkerFunctionLoadError));
307-
308-
_eventSubscriptions.Add(_inboundWorkerEvents.Where(msg => msg.MessageType == MsgType.FunctionLoadResponseCollection)
309-
.Subscribe((msg) => LoadResponse(msg.Message.FunctionLoadResponseCollection), HandleWorkerFunctionLoadError));
310302
}
311303

312304
// Load Request is also sent for disabled function as it is invocable using the portal and admin endpoints
@@ -470,16 +462,6 @@ internal void LoadResponse(FunctionLoadResponse loadResponse)
470462
_inputLinks.Add(disposableLink);
471463
}
472464

473-
internal void LoadResponse(FunctionLoadResponseCollection loadResponseCollection)
474-
{
475-
_workerChannelLogger.LogDebug("Received FunctionLoadResponseCollection with number of functions: '{count}'.", loadResponseCollection.FunctionLoadResponses.Count);
476-
477-
foreach (FunctionLoadResponse loadResponse in loadResponseCollection.FunctionLoadResponses)
478-
{
479-
LoadResponse(loadResponse);
480-
}
481-
}
482-
483465
internal async Task SendInvocationRequest(ScriptInvocationContext context)
484466
{
485467
try

test/WebJobs.Script.Tests/Workers/Rpc/GrpcWorkerChannelTests.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -489,39 +489,6 @@ public void ReceivesInboundEvent_FunctionLoadResponse()
489489
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Received FunctionLoadResponse for function: 'js1' with functionId: 'TestFunctionId1'.")));
490490
}
491491

492-
[Fact]
493-
public void ReceivesInboundEvent_Failed_FunctionLoadResponses()
494-
{
495-
var functionMetadatas = GetTestFunctionsList("node");
496-
_workerChannel.SetupFunctionInvocationBuffers(functionMetadatas);
497-
_workerChannel.SendFunctionLoadRequests(null, TimeSpan.FromMinutes(1));
498-
_testFunctionRpcService.PublishFunctionLoadResponsesEvent(
499-
new List<string>() { "TestFunctionId1", "TestFunctionId2" },
500-
new StatusResult() { Status = StatusResult.Types.Status.Failure });
501-
var traces = _logger.GetLogMessages();
502-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Setting up FunctionInvocationBuffer for function: 'js1' with functionId: 'TestFunctionId1'")));
503-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Setting up FunctionInvocationBuffer for function: 'js2' with functionId: 'TestFunctionId2'")));
504-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Worker failed to load function: 'js1' with function id: 'TestFunctionId1'.")));
505-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Worker failed to load function: 'js2' with function id: 'TestFunctionId2'.")));
506-
}
507-
508-
[Fact]
509-
public void ReceivesInboundEvent_FunctionLoadResponses()
510-
{
511-
var functionMetadatas = GetTestFunctionsList("node");
512-
_workerChannel.SetupFunctionInvocationBuffers(functionMetadatas);
513-
_workerChannel.SendFunctionLoadRequests(null, TimeSpan.FromMinutes(1));
514-
_testFunctionRpcService.PublishFunctionLoadResponsesEvent(
515-
new List<string>() { "TestFunctionId1", "TestFunctionId2" },
516-
new StatusResult() { Status = StatusResult.Types.Status.Success });
517-
var traces = _logger.GetLogMessages();
518-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Setting up FunctionInvocationBuffer for function: 'js1' with functionId: 'TestFunctionId1'")));
519-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Setting up FunctionInvocationBuffer for function: 'js2' with functionId: 'TestFunctionId2'")));
520-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, string.Format("Received FunctionLoadResponseCollection with number of functions: '{0}'.", functionMetadatas.ToList().Count))));
521-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Received FunctionLoadResponse for function: 'js1' with functionId: 'TestFunctionId1'.")));
522-
Assert.True(traces.Any(m => string.Equals(m.FormattedMessage, "Received FunctionLoadResponse for function: 'js2' with functionId: 'TestFunctionId2'.")));
523-
}
524-
525492
[Fact]
526493
public void ReceivesInboundEvent_Successful_FunctionMetadataResponse()
527494
{

test/WebJobs.Script.Tests/Workers/Rpc/TestFunctionRpcService.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,6 @@ public void PublishFunctionLoadResponseEvent(string functionId)
6262
_eventManager.Publish(new InboundGrpcEvent(_workerId, responseMessage));
6363
}
6464

65-
public void PublishFunctionLoadResponsesEvent(List<string> functionIds, StatusResult statusResult)
66-
{
67-
FunctionLoadResponseCollection functionLoadResponseCollection = new FunctionLoadResponseCollection();
68-
69-
foreach (string functionId in functionIds)
70-
{
71-
FunctionLoadResponse functionLoadResponse = new FunctionLoadResponse()
72-
{
73-
FunctionId = functionId,
74-
Result = statusResult
75-
};
76-
77-
functionLoadResponseCollection.FunctionLoadResponses.Add(functionLoadResponse);
78-
}
79-
80-
StreamingMessage responseMessage = new StreamingMessage()
81-
{
82-
FunctionLoadResponseCollection = functionLoadResponseCollection
83-
};
84-
_eventManager.Publish(new InboundGrpcEvent(_workerId, responseMessage));
85-
}
86-
8765
public void PublishFunctionEnvironmentReloadResponseEvent()
8866
{
8967
FunctionEnvironmentReloadResponse relaodEnvResponse = GetTestFunctionEnvReloadResponse();

0 commit comments

Comments
 (0)