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

[Reset] Add AllowChildReconnect flag in task generator #7157

Merged
merged 12 commits into from
Jan 25, 2025
Merged

Conversation

gow
Copy link
Contributor

@gow gow commented Jan 24, 2025

What changed?

Added a StartChildExecutionTask.AllowChildReconnect bool flag to mark the task at the time of reset. This flag is used to determine if we want to attempt to reconnect the child or not (instead of just checking if the workflow was reset)

Why?

In transferQueueActiveTaskExecutor.processStartChildExecution() I was checking the condition mutableState.IsResetRun() before attempting to reconnect to children. The problem is mutableState.IsResetRun() is true for the rest of the lifetime of the workflow. So if the workflow starts another instance of the same child somewhere down the line, we will reconnect to the previously completed instance of the child. So added an explicit flag in StartChildExecutionTask to determine if we should reconnect to the child or start a new instance.

How did you test it?

Existing unit test + manual testing.

Potential risks

N/A. The feature is gated behind a feature flag.

Documentation

N/A

Is hotfix candidate?

No

@gow gow requested a review from a team as a code owner January 24, 2025 01:40
@gow gow marked this pull request as draft January 24, 2025 01:40
@gow gow requested a review from yycptt January 24, 2025 17:14
@gow gow marked this pull request as ready for review January 24, 2025 17:14
@gow gow force-pushed the cg/reset_bug_fix branch from 5dc530c to 8207192 Compare January 24, 2025 22:05
@gow gow merged commit 8b5cd4d into main Jan 25, 2025
50 checks passed
@gow gow deleted the cg/reset_bug_fix branch January 25, 2025 00:34
pdoerner pushed a commit that referenced this pull request Jan 29, 2025
## What changed?
Added a `StartChildExecutionTask.AllowChildReconnect` bool flag to mark
the task at the time of reset. This flag is used to determine if we want
to attempt to reconnect the child or not (instead of just checking if
the workflow was reset)

## Why?
In `transferQueueActiveTaskExecutor.processStartChildExecution()` I was
checking the condition `mutableState.IsResetRun()` before attempting to
reconnect to children. The problem is `mutableState.IsResetRun()` is
true for the rest of the lifetime of the workflow. So if the workflow
starts another instance of the same child somewhere down the line, we
will reconnect to the previously completed instance of the child. So
added an explicit flag in StartChildExecutionTask to determine if we
should reconnect to the child or start a new instance.

## How did you test it?
Existing unit test + manual testing.

## Potential risks
N/A. The feature is gated behind a feature flag.

## Documentation
N/A

## Is hotfix candidate?
No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants