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
spawn launch --ttl 1d writes spawn:ttl=1d with no spawn:ttl-deadline, so neither spored nor the reaper enforces the TTL #990
Found while auditing writers of spawn:ttl for #983. I read the code and did not reproduce this live.
buildTags (pkg/aws/tags.go) writes spawn:ttl from config.TTL unconditionally, then writes spawn:ttl-deadline only if time.ParseDuration(config.TTL) succeeds:
time.ParseDuration has no d unit. --ttl is not validated at launch (cmd/launch_config.go only sets config.TTL = ttl; its ParseDuration there only gates the ceiling warning). Other spawn surfaces accept days: --fsx-ttl documents 7d, validateTTL in cmd/extend.go accepts 1d, and parseDuration/config.ParseDurationE in cmd parse it.
So spawn launch ... --ttl 1d would:
tag spawn:ttl=1d and no deadline;
spored: pkg/provider/ec2.go parses spawn:ttl with time.ParseDuration, fails, leaves config.TTL=0, so no TTL is enforced on the instance;
reaper: no spawn:ttl-deadline, so only the REAPER_MAX_AGE ceiling (7d default) bounds it.
The user asked for 1 day and gets up to 7 days.
Suggested fix: parse --ttl once at launch with the same parser everything else uses (or reject what cannot be parsed), and fail the launch rather than tag a TTL without a deadline. TestEveryTTLTagWriterAlsoWritesTheDeadline (#983) checks that buildTags writes both tags somewhere in the function. It cannot see that one of the writes is conditional, so it does not catch this case.
Activity
Make extend --job-array-* move the enforced deadline; gate spawn:ttl …
Make extend --job-array-* move the enforced deadline; gate spawn:ttl …
Parse every TTL and lifecycle duration with one day-aware parser; nev…
Parse every TTL and lifecycle duration with one day-aware parser; nev…
Parse every TTL and lifecycle duration with one day-aware parser; nev…