Skip to content

Commit 09b9330

Browse files
committed
Add comments to describe why we retry
Signed-off-by: halspang <[email protected]>
1 parent 6964e90 commit 09b9330

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ public async Task ExecuteAsync(CancellationToken cancellation)
6767
}
6868
catch (RpcException ex) when (ex.StatusCode == StatusCode.NotFound)
6969
{
70-
// Task hub is not found or insufficient permissions - retry
70+
// We retry on a NotFound for several reasons:
71+
// 1. It was the existing behavior through the UnexpectedError path.
72+
// 2. A 404 can be returned for a missing task hub or authentication failure. Authentication takes
73+
// time to propagate so we should retry instead of making the user restart the application.
74+
// 3. In some cases, a task hub can be created separately from the scheduler. If a worker is deployed
75+
// between the scheduler and task hub, it would need to be restarted to function.
7176
this.Logger.TaskHubNotFound();
7277
}
7378
catch (OperationCanceledException) when (cancellation.IsCancellationRequested)

0 commit comments

Comments
 (0)