Skip to content

Detached sweep members launch with no UserData, so spored never runs on them (#725 follow-up; blocks #1313) #1323

Closed

Description

@scttfrdmn

Detached (Lambda-orchestrated) sweep members still launch with no UserData, so spored never runs on them. #725 closed the out-of-band half (the rows now carry spawn:managed and spawn:ttl-deadline, so the TTL reaper can end them) and said explicitly that in-instance enforcement was not fixed. Nothing has tracked that second half since.

Evidence (main @ 1de1049, v0.146.0; code trace, not run on AWS)

  • lambda/sweep-orchestrator/main.go builds RunInstancesInput in tryLaunchInstanceSingleRegion (~L745) and tryLaunchInstance (~L1562). Neither one sets UserData. The LaunchConfig.UserData field (L181) is declared and never read.
  • The orchestrator's own comment on sweepRowLifecycleTags (~L708) says: "No UserData, so no spored: no TTL, idle or cost enforcement in-instance. That is NOT fixed here; it needs the config to reach this Lambda at all."
  • The AMI comes from seedDetachedLaunchKeys → GetRecommendedAMI, which resolves the stock AL2023 SSM parameters (/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-*, pkg/aws/ami.go:24). spored is not baked into that AMI.
  • The foreground sweep path does build user data (cmd/launch_sweep.go:491, buildUserData). Only the detached path, which is the default for --param-file, has none.

Consequences

  • A detached row has no in-instance TTL, idle stop, cost limit, DNS or completion handling. Its lifetime depends entirely on the reaper's next cycle, and only in regions the reaper covers.
  • Detached (Lambda-orchestrated) sweeps never verify spored on their members (#1305 follow-up) #1313 cannot be implemented as written. It asks the orchestrator to terminate a member that has run past the spored budget (5 min) with no spawn:last-heartbeat. Today that describes every detached member, so the check would kill every detached sweep at the 5-minute mark. The heartbeat check only makes sense once the orchestrator launches members with the spored bootstrap.

Suggested

Get the bootstrap to the orchestrator: have the CLI ship the encoded user data (or the inputs needed to build it) in the uploaded params/sweep record, and set RunInstancesInput.UserData from it. Then do #1313's verification on top. That needs the user-data budget (16 KiB) and a decision about where the bootstrap is built (CLI or Lambda).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions