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

Add methods to check workflow size violations for several other fields #3602

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

MichaelSnowden
Copy link
Contributor

What changed?
I generalized our workflow size limit constraints to 4 fields (child workflows, activities, external signals, and cancel requests).

Why?
I made this change so that we can limit these fields which could potentially cause issues if they're too large.

How did you test it?
I added unit tests.

Potential risks
These new methods aren't called yet.

Is hotfix candidate?
No.

@MichaelSnowden MichaelSnowden requested a review from a team as a code owner November 16, 2022 01:07
@MichaelSnowden MichaelSnowden force-pushed the ms-limits/all-limits branch 2 times, most recently from d3adf20 to 4e47e2b Compare November 16, 2022 05:58
@MichaelSnowden MichaelSnowden force-pushed the ms-limits/wf-size-checker-all-limits branch from 8213f82 to 3ae2811 Compare November 16, 2022 06:04
service/history/commandChecker.go Outdated Show resolved Hide resolved
service/history/commandChecker.go Outdated Show resolved Hide resolved
service/history/commandChecker.go Outdated Show resolved Hide resolved
service/history/commandChecker.go Outdated Show resolved Hide resolved
@MichaelSnowden MichaelSnowden force-pushed the ms-limits/wf-size-checker-all-limits branch from 3ae2811 to 655e2bd Compare November 18, 2022 01:02
@MichaelSnowden MichaelSnowden changed the base branch from ms-limits/all-limits to master November 18, 2022 01:03
@MichaelSnowden MichaelSnowden changed the base branch from master to ms-limits/all-limits November 18, 2022 01:04
Comment on lines 202 to 203
key.RunID,
key.WorkflowID,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't mean to have the workflow id and run id in the error. Can we log an error message? Or the caller will do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do that on line 207, and the logger is tagged with those values on 187

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed this from the inline error message

@MichaelSnowden MichaelSnowden force-pushed the ms-limits/wf-size-checker-all-limits branch from 655e2bd to 352e1c9 Compare November 18, 2022 16:59
Base automatically changed from ms-limits/all-limits to master November 18, 2022 17:27
@MichaelSnowden MichaelSnowden force-pushed the ms-limits/wf-size-checker-all-limits branch from 352e1c9 to 647ab7a Compare November 18, 2022 18:33
@MichaelSnowden MichaelSnowden force-pushed the ms-limits/wf-size-checker-all-limits branch from 647ab7a to 0819438 Compare November 18, 2022 19:04
numPending,
errLimit,
dynamicconfig.NumPendingChildExecutionsLimitError,
)
logger.Error(err.Error(), tag.Error(err))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you can do

logger.Error("some error message", 
    tag.WorkflowNamespaceID(key.NamespaceID),
    tag.WorkflowID(key.WorkflowID),
    tag.WorkflowRunID(key.RunID),
    tag.Error(err))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I did it this way because originally I logged a warning as well. I'll clean up in a follow up

)
logger.Error(err.Error(), tag.Error(err))
return err
}

const (
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: move const to the top?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do in a follow up, keeping in the interest of time

@MichaelSnowden MichaelSnowden merged commit e4d1b98 into master Nov 18, 2022
@MichaelSnowden MichaelSnowden deleted the ms-limits/wf-size-checker-all-limits branch November 18, 2022 21:13
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