Skip to content

Commit 6a5b0dd

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 77af874 commit 6a5b0dd

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## (Unreleased)
4+
- Add specific logging for NotFound error on worker connection by @halspang in ([#413](https://github.com/microsoft/durabletask-dotnet/pull/413))
5+
36
## v1.10.0
47
- Update DurableTask.Core to v3.1.0 and Bump version to v1.10.0 by @nytian in([#411](https://github.com/microsoft/durabletask-dotnet/pull/411))
58

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)