Skip to content

fix: concurrent map write for migrating schedules back to v1#10164

Merged
davidporter-id-au merged 2 commits intotemporalio:mainfrom
davidporter-id-au:bugfix/address-concurrent-map-write
May 4, 2026
Merged

fix: concurrent map write for migrating schedules back to v1#10164
davidporter-id-au merged 2 commits intotemporalio:mainfrom
davidporter-id-au:bugfix/address-concurrent-map-write

Conversation

@davidporter-id-au
Copy link
Copy Markdown
Contributor

@davidporter-id-au davidporter-id-au commented May 2, 2026

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?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

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

@davidporter-id-au davidporter-id-au changed the title hopefully fix concurrent map write fix: concurrent map write for migrating schedules back to v1 May 2, 2026
@davidporter-id-au davidporter-id-au marked this pull request as ready for review May 2, 2026 18:48
@davidporter-id-au davidporter-id-au requested a review from a team as a code owner May 2, 2026 18:48
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)},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks like memo map is not mutated so should be fine without cloning.

@davidporter-id-au davidporter-id-au enabled auto-merge (squash) May 4, 2026 03:53
Copy link
Copy Markdown

@harani-mukkala harani-mukkala left a comment

Choose a reason for hiding this comment

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

Could you file a follow-up task for adding test coverage.

@davidporter-id-au davidporter-id-au merged commit 145f109 into temporalio:main May 4, 2026
47 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.

3 participants