I am running several hourly Temporal Schedules written in Python. A couple of days ago, we added a 5 minute jitter to all Schedules to avoid them all triggering right on the hour mark. However, I noticed that doing so made a backfill script that we ran occassionally stop working: It was impossible to use it to trigger backfills, despite it working perfectly fine in the past.
This script is as follows, imagine we are backfilling from 3 am to 4 am on 2023-09-25 (ignore the missing asyncio boilerplate):
handle = client.get_schedule_handle("my-schedule")
start_at = dt.datetime(2023, 9, 25, 3, 0, 0, tzinfo=dt.timezone.utc)
end_at = dt.datetime(2023, 9, 25, 4, 0, 0, tzinfo=dt.timezone.utc)
backfill = ScheduleBackfill(start_at=start_at, end_at=end_at, overlap=ScheduleOverlapPolicy.ALLOW_ALL)
await handle.backfill(backfill)
What I noticed was that adding a few minutes to the end_at
cause the backfill to create the expected workflow runs:
end_at = dt.datetime(2023, 9, 25, 4, 5, 0, tzinfo=dt.timezone.utc)
I also noticed that removing the jitter (setting it to None
) caused the old version of the script to work again.
So, I would like to confirm that when setting a jitter value in our Schedule, our end_at
when backfilling needs to now account for it. This is not covered by the documentation but it would make sense as having the schedule run through the hour mark would potentially not cause it to trigger if the jitter landed in a value > 0.
Thank you!