Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskOrchestrationContextWrapper.CallSubOrchestratorAsync does not provide instance Id properly when RetryPolicy is specified #174

Closed
ReluXingZeng opened this issue Jul 28, 2023 · 0 comments · Fixed by #177
Assignees
Labels
bug Something isn't working

Comments

@ReluXingZeng
Copy link

ReluXingZeng commented Jul 28, 2023

Hello there,

In TaskOrchestrationContextWrapper.CallSubOrchestratorAsync, we have:

public override async Task<TResult> CallSubOrchestratorAsync<TResult>(
TaskName orchestratorName,
object? input = null,
TaskOptions? options = null)
{
// TODO: Check to see if this orchestrator is defined
static string? GetInstanceId(TaskOptions? options)
=> options is SubOrchestrationOptions derived ? derived.InstanceId : null;
string instanceId = GetInstanceId(options) ?? this.NewGuid().ToString("N");
try
{
if (options?.Retry?.Policy is RetryPolicy policy)
{
return await this.innerContext.CreateSubOrchestrationInstanceWithRetry<TResult>(
orchestratorName.Name,
orchestratorName.Version,
policy.ToDurableTaskCoreRetryOptions(),
input);
}
else if (options?.Retry?.Handler is AsyncRetryHandler handler)

Where the instanceId extracted from the Option. However, when options?.Retry?.Policy is RetryPolicy policy is enabled, this instanceId is no longer used.

The function CreateSubOrchestrationInstanceWithRetry should support sending instanceId if using the following override:

https://github.com/Azure/durabletask/blob/1bb5c8f964f085bcdd6268c0fb5ec76a0701fb5a/src/DurableTask.Core/OrchestrationContext.cs#L249-L265

I wonder if this needs to be changed

@jviau jviau added the bug Something isn't working label Jul 31, 2023
@jviau jviau self-assigned this Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants