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

Remove SkipGenerateWorkflowTask from signal APIs #6810

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexshtin
Copy link
Member

@alexshtin alexshtin commented Nov 13, 2024

What changed?

Remove SkipGenerateWorkflowTask flag from signal APIs request. Some sort of revert of #4091.

Why?

This flag breaks important system invariant: Workflow history must end with Workflow Task event OR event that is no-op for SDK (such as ActivityScheduled or TimerStarted). This invariant will be leverage at #6709 where server must guarantee that it won't ship actual (non command) events to the worker twice.

PR to remove flag from APIs: temporalio/api#476.

How did you test it?

Existing tests.

Potential risks

Although this flag is not exposed by any SDK and not documented, there is a chance that someone use it in production scenarios. For them it will be a breaking change.

Documentation

Not documented.

Is hotfix candidate?

No.

Copy link
Contributor

@pdoerner pdoerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but would like someone from CGS to double check the reapply logic.

@alexshtin alexshtin marked this pull request as ready for review November 14, 2024 01:35
@alexshtin alexshtin requested a review from a team as a code owner November 14, 2024 01:35
@@ -472,16 +472,11 @@ func (handler *WorkflowTaskCompletedHandler) Invoke(
}
}

bufferedEventShouldCreateNewTask := hasBufferedEventsOrMessages && ms.HasAnyBufferedEvent(eventShouldGenerateNewTaskFilter)
if hasBufferedEventsOrMessages && !bufferedEventShouldCreateNewTask {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there is buffer events, we should still flush those events?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buffered events are flushed when new WFT is scheduled. This code was just to flush them if new WFT will not be created.

Copy link
Contributor

@yux0 yux0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event reapply logic LGTM

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.

3 participants