Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Changelog

## (Unreleased)

- Add automatic retry for gateway timeout in `GrpcDurableTaskClient.WaitForInstanceCompletionAsync` in [#412](https://github.com/microsoft/durabletask-dotnet/pull/412))

## v1.10.0
- 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))

- 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))

## v1.9.1

- Add basic orchestration and activity execution logs by @cgillum in ([#405](https://github.com/microsoft/durabletask-dotnet/pull/405))
- Add default version in `TaskOrchestrationContext` by @halspang in ([#408](https://github.com/microsoft/durabletask-dotnet/pull/408))

Expand Down
28 changes: 19 additions & 9 deletions src/Client/Grpc/GrpcDurableTaskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

if (Activity.Current?.Id != null || Activity.Current?.TraceStateString != null)
{
if (request.ParentTraceContext == null)

Check warning on line 110 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 110 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 110 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.
{
request.ParentTraceContext = new P.TraceContext();
}
Expand All @@ -125,7 +125,7 @@

DateTimeOffset? startAt = options?.StartAt;
this.logger.SchedulingOrchestration(
request.InstanceId,

Check warning on line 128 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 128 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 128 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.
orchestratorName,
sizeInBytes: request.Input != null ? Encoding.UTF8.GetByteCount(request.Input) : 0,
startAt.GetValueOrDefault(DateTimeOffset.UtcNow));
Expand Down Expand Up @@ -348,17 +348,27 @@
GetInputsAndOutputs = getInputsAndOutputs,
};

try
while (!cancellation.IsCancellationRequested)
{
P.GetInstanceResponse response = await this.sidecarClient.WaitForInstanceCompletionAsync(
request, cancellationToken: cancellation);
return this.CreateMetadata(response.OrchestrationState, getInputsAndOutputs);
}
catch (RpcException e) when (e.StatusCode == StatusCode.Cancelled)
{
throw new OperationCanceledException(
$"The {nameof(this.WaitForInstanceCompletionAsync)} operation was canceled.", e, cancellation);
try
{
P.GetInstanceResponse response = await this.sidecarClient.WaitForInstanceCompletionAsync(
request, cancellationToken: cancellation);
return this.CreateMetadata(response.OrchestrationState, getInputsAndOutputs);
}
catch (RpcException e) when (e.StatusCode == StatusCode.Cancelled)
{
throw new OperationCanceledException(
$"The {nameof(this.WaitForInstanceCompletionAsync)} operation was canceled.", e, cancellation);
}
catch (RpcException e) when (e.StatusCode == StatusCode.DeadlineExceeded)
{
// Gateway timeout/deadline exceeded can happen before the request is completed. Do nothing and retry.
}
}

// If the operation was cancelled in between requests, we should still throw instead of returning a null value.
throw new OperationCanceledException($"The {nameof(this.WaitForInstanceCompletionAsync)} operation was canceled.");
}

/// <inheritdoc/>
Expand Down
Loading