Skip to content

Reset retention timer when schedule is unpaused#9862

Open
gurudatta-patil wants to merge 10 commits intotemporalio:mainfrom
gurudatta-patil:fix/schedule-retention-on-unpause
Open

Reset retention timer when schedule is unpaused#9862
gurudatta-patil wants to merge 10 commits intotemporalio:mainfrom
gurudatta-patil:fix/schedule-retention-on-unpause

Conversation

@gurudatta-patil
Copy link
Copy Markdown

@gurudatta-patil gurudatta-patil commented Apr 8, 2026

What changed?

Fixed schedule retention on unpause.

If a schedule stayed paused longer than retention, unpausing could close the scheduler workflow right away.
Now unpause resets the retention timer so retention starts from unpause time.

Also added a regression unit test for this case.

Why?

Paused time should not cause the schedule to age out immediately after unpause.
This matches expected schedule behavior.

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)

Ran the test before change and after change. Since minor change, built and created a unit test

Potential risks

Small behavior change around retention timing after unpause.

Fixes #9752

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 8, 2026

CLA assistant check
All committers have signed the CLA.

@chaptersix
Copy link
Copy Markdown
Contributor

chaptersix commented Apr 8, 2026

Thank you for you contribution! Could update the chasm/lib/scheduler path as well?

gurudatta-patil and others added 3 commits April 8, 2026 17:38
Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
@gurudatta-patil
Copy link
Copy Markdown
Author

gurudatta-patil commented Apr 8, 2026

Updated the chasm/lib/scheduler path

// trigger immediately timestamp is added to the PatchRequest
TriggerImmediatelyTimestamp = 12
// reset retention timer when a paused schedule is unpaused
ResetRetentionOnUnpause = 13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

	// Versions of workflow logic. When introducing a new version, consider generating a new
	// history for TestReplays using generate_history.sh.

please do this

Copy link
Copy Markdown
Author

@gurudatta-patil gurudatta-patil Apr 14, 2026

Choose a reason for hiding this comment

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

Uploaded the replay files of the history. Should I keep the default name or change the name. Unfamiliar with naming convention

@chaptersix
Copy link
Copy Markdown
Contributor

run make lint locally to view and fix lint errors.

gurudatta-patil and others added 2 commits April 13, 2026 18:38
Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
@chaptersix
Copy link
Copy Markdown
Contributor

Everything else LGTM.
@lina-temporal could you take a look as well?

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.

Unpaused schedules should not be immediately deleted

3 participants