fix: concurrent map write for migrating schedules back to v1#10164
Merged
davidporter-id-au merged 2 commits intotemporalio:mainfrom May 4, 2026
Merged
Conversation
yycptt
approved these changes
May 2, 2026
| WorkflowIdReusePolicy: enumspb.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE, | ||
| WorkflowIdConflictPolicy: enumspb.WORKFLOW_ID_CONFLICT_POLICY_FAIL, | ||
| Memo: &commonpb.Memo{Fields: result.memo}, | ||
| Memo: &commonpb.Memo{Fields: maps.Clone(result.memo)}, |
Member
There was a problem hiding this comment.
looks like memo map is not mutated so should be fine without cloning.
harani-mukkala
approved these changes
May 4, 2026
harani-mukkala
left a comment
There was a problem hiding this comment.
Could you file a follow-up task for adding test coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Some observed panics in production spotted by @yycptt were causing crashes. The mutation
searchattribute.AddSearchAttribute(&sa, sadefs.TemporalNamespaceDivision, payload.EncodeString(legacyscheduler.NamespaceDivision))presumably intermittently was happening while another read was happening elsewhere in the system, causing a crash.Why?
Need to avoid panics in prod
How did you test it?
Potential risks
Not expected to be high risk as it's just a clone, might need some more test coverage however. I am unsure if we have enough coverage to ensure there's no data drops