Skip to content

Launches through spawn-ts never mark the shared-account lifecycle lease (spore-host-lifecycle) #143

Backlog

Description

@scttfrdmn

Found while investigating spore-host/spawn#1672. Part of the leave-no-trace epic, spore-host/spore-host#752.

The gap

Go spawn marks itself ACTIVE in the account's shared lifecycle lease before every create. The lease is the DynamoDB table spore-host-lifecycle, one per region plus us-east-1 for global, written through pkg/lifecyclemark.Mark and libs lifecycle.MarkActive (spawn#1654). The mark matters in two ways:

  • The idle teardown (the TTL reaper's account-idle sweep) only judges a scope that some creator has marked.
  • A teardown that holds the lease blocks a mark, which fences the create.

spawn-ts has no lease code and no DynamoDB client. Its AWS dependencies are client-ec2, client-service-quotas, client-ssm and client-sts. So no launch through spawn-ts marks anything:

  • scripts/live-smoke.mjs, as GitHubActions-spawn-ts-live-smoke in dev 435415984226;
  • the portal's real-AWS e2e setup launch (spore-host web/portal/e2e-aws, as spore-portal-e2e-teardown);
  • the BYOA demo;
  • the portal's launch actions when they return after 1.0 (spore-host#686).

That has two effects:

  1. Leave-no-trace never fires for an account where only spawn-ts launches. The regions stay "lease unavailable", which fails safe.
  2. The launch isn't fenced in a region another creator did mark. The teardown's activity re-check sees spawn-ts's spawn:managed instances, but nothing stops a teardown that already holds the lease. Once spawn arms reap (Flip spawn idle teardown (A4/A5) to reap spawn#1657), that teardown can delete spawn's shared security groups and key pairs while a spawn-ts launch is using them.

spawn#1672 proposed granting the lease to the roles spawn-ts runs as. That changes nothing until spawn-ts writes the lease.

To do

  • Port MarkActive's protocol, as libs/lifecycle defines it:
    • one TransactWriteItems: a ConditionCheck that the closing sentinel table#closing is absent, plus an Update of spawn#<scope> that sets ACTIVE and epoch+1, on condition that no live lease exists;
    • create the table, tagged, on the first mark;
    • wait while a teardown holds the lease;
    • never fail the launch.
  • Treat the protocol as a wire contract with libs/lifecycle (the item shape changed in libs v0.56.0), held by a contract test against libs's fixtures.
  • Whichever role then runs the launch needs dynamodb:ConditionCheckItem, UpdateItem, PutItem, DeleteItem, DescribeTable, CreateTable and TagResource on arn:aws:dynamodb:*:<account>:table/spore-host-lifecycle:
    • the live-smoke launch role;
    • the e2e setup role;
    • for #686, spore-portal-launch, which is read-only today by design (spore-host#645).
  • Never mark in spore.host's infra account 966362334030, which has no lease.

Activity

  1. added this to the Hardening milestone on Nov 25, 2026
  2. added
    enhancement
    area: aws
    cost-safety
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: awscost-safetyenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions