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

Fix flaky build id issue #1338

Merged
merged 6 commits into from
Jan 9, 2024
Merged

Conversation

Sushisource
Copy link
Member

@Sushisource Sushisource commented Jan 5, 2024

This should fix the only case where I could imagine the id not being set. Could not repro locally.

@Sushisource Sushisource marked this pull request as ready for review January 5, 2024 20:50
@Sushisource Sushisource requested a review from a team as a code owner January 5, 2024 20:50
@@ -1028,10 +1028,16 @@ ProcessEvents:
}
if isReplay {
w.workflowInfo.currentTaskBuildID = currentBuildID
} else if !isReplay && !isQueryOnlyTask {
} else if !isQueryOnlyTask {
// Query only tasks should use the build ID from the workflow task, not the worker's
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment seem irrelevant now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I made them better

// Query only tasks should use the build ID from the workflow task, not the worker's
// build id, since the user cares about what affected workflow state.
w.workflowInfo.currentTaskBuildID = w.wth.workerBuildID
} else {
// It is a query only task, and we're not replaying somehow - still use the task's build
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 understand this comment, didn't we discuss before that queries are always treated as not replaying?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I can just get rid of the not replaying part

} else {
// It *is* a query only task, use the task's build ID (queries are considered non-replay
// in go sdk), but only if one was actually discovered.
if currentBuildID != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

When is currentBuildID empty?

Copy link
Member Author

Choose a reason for hiding this comment

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

It can be empty here if the lookahead didn't find anything, but we wouldn't want to overwrite some previous task which did find something.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I am wondering what scenario look ahead can't find anything?

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem is sort of specific to queries on the first task I think. No WFT completed event exists yet to be looked-ahead-to (well, it does actually in the query, but we don't read it since we're already up-to-date), but the nextTask code still runs, which then returns this as empty.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I didn't think of the first WFT thanks for clarifying

@Sushisource Sushisource enabled auto-merge (squash) January 8, 2024 18:48
@Sushisource Sushisource disabled auto-merge January 8, 2024 18:48
@Sushisource Sushisource enabled auto-merge (squash) January 8, 2024 18:48
@Sushisource Sushisource disabled auto-merge January 8, 2024 20:52
@Sushisource Sushisource merged commit 1fe10d5 into temporalio:master Jan 9, 2024
12 checks passed
@Sushisource Sushisource deleted the build-id-fix branch January 9, 2024 17:38
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