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 canary jitter workflow debugging log #6278

Merged
merged 14 commits into from
Sep 11, 2024
15 changes: 14 additions & 1 deletion service/frontend/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1889,13 +1889,26 @@
if err != nil {
return nil, err
}
wh.GetLogger().Debug("Start workflow execution request domainID", tag.WorkflowDomainID(domainID))
historyRequest, err := common.CreateHistoryStartWorkflowRequest(
domainID, startRequest, time.Now(), wh.getPartitionConfig(ctx, domainName))
if err != nil {
return nil, err
}

// for debugging jitter workflow
// will be removed later
jitterStartSeconds := startRequest.GetJitterStartSeconds()
if startRequest.GetDomain() == "cadence-canary" && jitterStartSeconds > 0 {
wh.GetLogger().Debug("Start workflow execution request domainID",
tag.WorkflowDomainID(domainID),
tag.WorkflowID(startRequest.WorkflowID),
tag.Dynamic("JitterStartSeconds", jitterStartSeconds),
tag.Dynamic("firstDecisionTaskBackoffSeconds", historyRequest.GetFirstDecisionTaskBackoffSeconds()),
)

Check warning on line 1907 in service/frontend/api/handler.go

View check run for this annotation

Codecov / codecov/patch

service/frontend/api/handler.go#L1902-L1907

Added lines #L1902 - L1907 were not covered by tests
Comment on lines +1902 to +1907
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to cover these in tests ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@bowenxia I wonder if you need to have this permanently or just for debugging.
If it's purely for debugging (I guess so since tags are too specific) then you can temporarily deploy your own branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I talked about this in Cadence all hands, this kind of error happens randomly. It had been happened in Prod07, Prod04, Prod12 etc. I can't predict which environment will have that error, so I'll have to merge it to main and turn on the debug mode once this is once happen in the future. :(

} else {
wh.GetLogger().Debug("Start workflow execution request domainID", tag.WorkflowDomainID(domainID))
}

resp, err = wh.GetHistoryClient().StartWorkflowExecution(ctx, historyRequest)
if err != nil {
return nil, err
Expand Down
Loading