You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Schedule params orphaned after the record TTL in three edge cases (failed one-time firing, paused past end-after, cadence > 30 days) #1398
Follow-up to #1382 (PR for branch fix/1382-1383-schedule-lifetime-region).
After that PR, a schedule's params object (spawn-schedules-<region>/schedules/<id>/params.yaml) has no lifecycle expiry. It is deleted by spawn schedule cancel (scheduler.Client.DeleteSchedule), or by scheduler-handler when the schedule runs out (CompleteSchedule: on the launch that reaches max_executions, after a one-time schedule's successful launch, or on the first firing after end_after).
Three paths still leave the params object behind once the record's TTL deletes the record. After that, nothing names the object.
A one-time schedule whose only firing fails. The handler completes it only on success: a failed launch returns an error so Lambda's async retries can try again, and it can't tell which attempt is the last. The EventBridge schedule deletes itself (ActionAfterCompletion=DELETE) and the record expires at at + 30 days. The params stay.
An --end-after schedule that is paused past its end. A disabled schedule does not fire, so no post-end firing completes it. The record expires at end_after + 30 days. The EventBridge schedule has EndDate = the same instant. AWS does not say whether a DISABLED schedule self-deletes at EndDate; not verified. The params stay.
An --end-after schedule whose cadence is longer than 30 days. No firing lands between end_after and end_after + 30 days, so the same outcome as (2).
All three need the cases above plus a TTL expiry. Each leaves one small S3 object. Today the spawn-schedules table holds 0 items (#1382 comment), so no live object is affected.
Suggested fix: a verifying sweeper, in the reaper or spawn cleanup. It lists schedules/*/params.yaml in spawn-schedules-*, and deletes an object only when (a) no record with that schedule_id exists and (b) the object is older than RecordTTLMargin. It must not delete batch queue configs (tagged Component=queue; they have their own 7-day rule) or params of a schedule being created right now (the CLI uploads the params before it writes the record, hence the age check). pkg/instancerole/schedules.go (#1378) already reads both the table and the params objects, on the same credentials.
Activity
feat(reaper): REAPER_SCHEDULE_PARAMS sweep of orphaned schedule params (
feat(cleanup): spawn cleanup --schedule-params (#1398)
test(iamcoverage): say what the site claim does and does not check (#…
feat(schedulesweep): verifying sweeper for orphaned schedule params (#…
feat(reaper): REAPER_SCHEDULE_PARAMS sweep of orphaned schedule params (
feat(cleanup): spawn cleanup --schedule-params (#1398)
test(iamcoverage): say what the site claim does and does not check (#…
feat(cleanup,reaper): delete orphaned schedule params (#1398) (#1414)