Skip to content

spawn extend --job-array-* writes only spawn:ttl, so it never moves the deadline spored and the reaper enforce #983

Closed

Description

@scttfrdmn

Found while fixing #950. I read the code and did not reproduce this live.

extendJobArrayWithAudit (cmd/extend.go) updates each instance with only:

return client.UpdateInstanceTags(ctx, region, instanceID, map[string]string{
    "spawn:ttl": newTTL,
})

spawn:ttl-deadline is what the system actually enforces:

  • spored: pkg/agent/agent.go treats TTLDeadline as authoritative whenever it is set, and synthesizes one from spawn:ttl only when the deadline tag is missing (around line 182).
  • TTL reaper: evaluate in lambda/ttl-reaper/main.go reads only spawn:ttl-deadline.

Every instance launched with --ttl carries a deadline. So spawn extend --job-array-name X 4h prints "✅ Job array TTL extended!" and changes nothing that is enforced: each instance still dies at its original deadline. It also overwrites spawn:ttl with the raw argument, which is the #506 symptom on this path.

The single-instance path fixed both problems through computeExtendedTTLTags (#506) and ttlpkg.Tags. The comment above the cost-limit warning in the array path says that path "writes a RELATIVE spawn:ttl rather than a deadline". That reads like a known limitation, but nothing tells the user.

Suggested fix: run each array instance through computeExtendedTTLTags, as the single path does. That moves the deadline and keeps spawn:ttl meaning total-from-launch. Then apply the #639 cost-limit decision per instance, and the #950 spotrequest.ExtendWarning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions