Skip to content

Conversation

ychebotarev
Copy link
Contributor

@ychebotarev ychebotarev commented Apr 25, 2025

What changed?
Add two new flags to activity heartbeat response:

  • reset_requested // indicates that reset happen while activity is still running
  • reset_heartbeat //indicates that user asked to also reset heartbeats

Why?
Product request.

Breaking changes
No

Corresponding Server PR: temporalio/temporal#7677

@ychebotarev ychebotarev requested review from a team as code owners April 25, 2025 19:50

// Will be set to true if the activity was reset.
// Applyes only to the current run.
bool activity_reset = 3;
Copy link
Member

Choose a reason for hiding this comment

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

Can I get confirmation that we want SDKs to interrupt running activities when this is true, same as we do for paused or cancel requested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My goal is to provide all the information.
I think we need to decide it separately.

Copy link
Member

@cretz cretz Apr 28, 2025

Choose a reason for hiding this comment

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

Would rather decide how we want SDK to react before merging this API (we obviously don't provide all information on heartbeat, we only provide what callers need, there is a ton of stuff about an activity we leave off).

In this case I suspect we will want to interrupt the activity.

Choose a reason for hiding this comment

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

@cretz that's right.

@ychebotarev ychebotarev merged commit ef67cbd into master May 2, 2025
5 checks passed
@ychebotarev ychebotarev deleted the y_reset_info branch May 2, 2025 02:09
ychebotarev added a commit to temporalio/temporal that referenced this pull request May 7, 2025
## What changed?
<!-- Describe what has changed in this PR -->
* Add "reset_activity" and "reset_heartbeat" flags to the activity info
* send "reset_requested" flag to the worker in response to heartbeat
request
* if "reset_heartbeat" flag was set - reset heartbeats for new attempt
only
* remove "reset_activity" and "reset_heartbeat" flags for the new
attempt

Corresponding API PR: temporalio/api#578

## Why?
<!-- Tell your future self why have you made these changes -->
To notify the workers/SDK that reset happens.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
Running existing tests.

Note: replication in the next PR
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.

5 participants