Skip to content

Commit 6964e90

Browse files
committed
Update logging for task hub NotFound
This commit updates the logging for when a task hub connection returns NotFound. Previously it was logged as an unknown error, it is now a warn. Signed-off-by: halspang <[email protected]>
1 parent e5189bf commit 6964e90

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## (Unreleased)
44

5-
- Add automatic retry on gateway timeout in `GrpcDurableTaskClient.WaitForInstanceCompletionAsync` in [#412](https://github.com/microsoft/durabletask-dotnet/pull/412))
5+
- - Add automatic retry on gateway timeout in `GrpcDurableTaskClient.WaitForInstanceCompletionAsync` in [#412](https://github.com/microsoft/durabletask-dotnet/pull/412))
6+
- Add specific logging for NotFound error on worker connection by @halspang in ([#413](https://github.com/microsoft/durabletask-dotnet/pull/413))
7+
68

79
## v1.10.0
810

src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public async Task ExecuteAsync(CancellationToken cancellation)
6565
// Sidecar is down - keep retrying
6666
this.Logger.SidecarUnavailable();
6767
}
68+
catch (RpcException ex) when (ex.StatusCode == StatusCode.NotFound)
69+
{
70+
// Task hub is not found or insufficient permissions - retry
71+
this.Logger.TaskHubNotFound();
72+
}
6873
catch (OperationCanceledException) when (cancellation.IsCancellationRequested)
6974
{
7075
// Shutting down, lets exit gracefully.

src/Worker/Grpc/Logs.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ static partial class Logs
2222
[LoggerMessage(EventId = 4, Level = LogLevel.Information, Message = "Sidecar work-item streaming connection established.")]
2323
public static partial void EstablishedWorkItemConnection(this ILogger logger);
2424

25+
[LoggerMessage(EventId = 5, Level = LogLevel.Warning, Message = "Task hub NotFound. Will continue retrying.")]
26+
public static partial void TaskHubNotFound(this ILogger logger);
27+
2528
[LoggerMessage(EventId = 10, Level = LogLevel.Debug, Message = "{instanceId}: Received request to run orchestrator '{name}' with {oldEventCount} replay and {newEventCount} new history events.")]
2629
public static partial void ReceivedOrchestratorRequest(this ILogger logger, string name, string instanceId, int oldEventCount, int newEventCount);
2730

0 commit comments

Comments
 (0)