Skip to content

Conversation

@bergundy
Copy link
Member

@bergundy bergundy commented Jan 22, 2026

What changed?

  • Return ObsoleteMatchingTask when standalone activity dispatch task is obsolete.
  • Set a stamp on the state and tasks for validation of current attempt.
  • Dedupe matching requests by request ID.

Why?

Avoid retrying these tasks invalid tasks and fix idempotency issues.

@bergundy bergundy requested review from a team as code owners January 22, 2026 18:57
@bergundy bergundy changed the title Drop obsolete standalone activity matching tasks Standalone activities RecordActivityTaskStarted fixes Jan 22, 2026
@bergundy bergundy force-pushed the drop-obsolete-saa-matching-task branch from 5dac8f4 to 9c9f347 Compare January 22, 2026 22:20
func(a *Activity, ctx chasm.MutableContext, request *historyservice.RecordActivityTaskStartedRequest) error {
attempt := a.LastAttempt.Get(ctx)
attempt.StartedTime = timestamppb.New(ctx.Now(a))
attempt.LastWorkerIdentity = request.GetPollRequest().GetIdentity()
Copy link
Contributor

@dandavison dandavison Jan 23, 2026

Choose a reason for hiding this comment

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

I think we need to capture the request ID from the request here (we only have the unit test).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thanks!

Copy link
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

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

This LGTM apart from accidentally missing setting the requestID in the transition. (The attempt/stamp changes LGTM).

@bergundy bergundy enabled auto-merge (squash) January 23, 2026 03:08
@bergundy bergundy merged commit 4786a75 into temporalio:main Jan 23, 2026
66 checks passed
@bergundy bergundy deleted the drop-obsolete-saa-matching-task branch January 23, 2026 04:19
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