Skip to content

Commit

Permalink
[RPC]Fix FunctionLoadTimeout (Azure#6935)
Browse files Browse the repository at this point in the history
  • Loading branch information
pragnagopa authored Nov 24, 2020
1 parent 4342df9 commit a1a90db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal class GrpcWorkerChannel : IRpcWorkerChannel, IDisposable
private IWorkerProcess _rpcWorkerProcess;
private TaskCompletionSource<bool> _reloadTask = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
private TaskCompletionSource<bool> _workerInitTask = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
private TimeSpan functionLoadTimeout = TimeSpan.FromMinutes(10);
private TimeSpan _functionLoadTimeout = TimeSpan.FromMinutes(10);

internal GrpcWorkerChannel(
string workerId,
Expand Down Expand Up @@ -259,9 +259,10 @@ public void SendFunctionLoadRequests(ManagedDependencyOptions managedDependencyO
{
if (functionTimeout.HasValue)
{
functionLoadTimeout = functionTimeout.Value > functionLoadTimeout ? functionTimeout.Value : functionLoadTimeout;
_functionLoadTimeout = functionTimeout.Value > _functionLoadTimeout ? functionTimeout.Value : _functionLoadTimeout;
_eventSubscriptions.Add(_inboundWorkerEvents.Where(msg => msg.MessageType == MsgType.FunctionLoadResponse)
.Timeout(functionLoadTimeout)
.Timeout(_functionLoadTimeout)
.Take(_functions.Count())
.Subscribe((msg) => LoadResponse(msg.Message.FunctionLoadResponse), HandleWorkerFunctionLoadError));
}
else
Expand Down

0 comments on commit a1a90db

Please sign in to comment.