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

Adding a framework for the Task validator service. #5446

Merged
merged 7 commits into from
Nov 13, 2023

Conversation

agautam478
Copy link
Contributor

@agautam478 agautam478 commented Nov 9, 2023

What changed?
The primary goal of this framework is to establish a reliable mechanism for detecting corruption during task processing within the Cadence system. It aims to create a versatile task validation framework applicable throughout the task processing environment. Various validation checks, such as StaleWorkflowCheck and DeprecateDomainCheck, will be introduced to enhance the framework.

The current pull request comprises the fundamental structure of the service, accompanied by its corresponding unit test.

In scenarios where we identify a synchronous API call error from the worker, indicating the completion of a decision task, we occasionally encounter the error "maximum attempts exceeded to update history." This situation proves to be detrimental, as the decision task enters an endless retry loop, causing the entire task list to become stuck.

err := h.GetTaskValidator().WorkflowCheckforValidation(workflowID, domainID, "") if err != nil { return err }

To address this, we are testing the invocation of the function call on this reported decision task to observe whether the logs are generated as expected.

Why?
These changes were made to ensure a slow incremental introduction of the taskvalidator in the system. We will proceed forward once we have verified that the logs generate as expected.

How did you test it?
Added a unit test.
Tested locally.

Potential risks
No potential risks.

Release notes
NA

Documentation Changes
NA

@agautam478 agautam478 marked this pull request as draft November 9, 2023 22:24
@agautam478 agautam478 marked this pull request as ready for review November 9, 2023 23:29
func (w *checkerImpl) WorkflowCheckforValidation(workflowID string, domainID string, runID string) error {
// Emitting just the log to ensure that the workflow is called for now.
// TODO: add some validations to check the wf for corruptions.
w.logger.Info(fmt.Sprintf("WorkflowCheckforValidation. DomainID: %v, WorkflowID: %v, RunID: %v",
Copy link
Member

Choose a reason for hiding this comment

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

the common pattern is to write a static message with log tags for variable stuff.

@agautam478 agautam478 merged commit b7a4724 into cadence-workflow:master Nov 13, 2023
16 checks passed
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.

4 participants