Skip to content

Conversation

@alexshtin
Copy link
Contributor

@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.

@alexshtin alexshtin force-pushed the feature/remove-skip-wft-flag branch from d1712e9 to 164cc98 Compare November 13, 2024 22:34
@alexshtin alexshtin force-pushed the feature/remove-skip-wft-flag branch from 164cc98 to 3a151d2 Compare November 13, 2024 22:52
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
}

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

@alexshtin alexshtin merged commit c1cb208 into temporalio:main Nov 15, 2024
@alexshtin alexshtin deleted the feature/remove-skip-wft-flag branch November 15, 2024 00:20
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