Skip to content

Detached sweep members get none of the spawn:* config tags: row commands never run, idle/cost/on-complete not enforced (#1323 follow-up) #1330

Closed

Description

@scttfrdmn

Found while doing #1323 / #1313. With #1323, detached (Lambda-orchestrated) sweep members boot spored. But the orchestrator still writes almost none of the spawn:* tags spored and the bootstrap read their configuration from, so the member's workload never runs and most of its lifecycle settings do nothing.

Evidence (main @ f887212 + the #1323 branch, code trace only, not run on AWS)

  • The orchestrator's only instance tags are spawn:sweep-id, spawn:sweep-index, Name, spawn:managed and, when the row has a ttl, spawn:ttl-deadline. They come from buildRunInstancesInput / sweepRowLifecycleTags (lambda/sweep-orchestrator/spored.go, main.go). grep -n 'Key: aws.String("spawn:' lambda/sweep-orchestrator/*.go finds exactly those.
  • The Lambda reads only ami, iam_role, instance_type, key_name, spot, ttl and spawn_user_data from the params. TestDetachedSweepSeedsEveryKeyTheLambdaReads enforces that list.
  • A sweep's per-row command: goes into Tags["spawn:command"] (cmd/sweep.go, buildLaunchConfigFromParams), and that is the only place the bootstrap reads it: pkg/launcher/bootstrap.go ~L1232, --filters ... "Name=key,Values=spawn:command". The spawn:param:* tags behind PARAM_* (~L1175) work the same way. The Lambda writes neither, so a detached member boots, starts spored, and runs nothing.
  • idle_timeout, cost_limit, on_complete, completion_file, completion_delay, hibernate_on_idle, session_timeout, dns, spot_max_price, volume_size, az, security groups, --pre-stop and the job-array/sweep env tags all live in tags or LaunchConfig fields the Lambda never sees (pkg/provider/ec2.go configFromTags). spored enforces only spawn:ttl-deadline. For example, a detached member's cost_limit: 8 caps nothing.
  • A detached sweep with no ttl gets no deadline. With no spawn:idle-timeout either, spored has nothing to enforce, and only the reaper's max-age ceiling bounds the member. The foreground path applies a 1h idle-timeout default for this case (applyIdleTimeoutDefault); the detached path does not.

Suggested

Have the CLI pre-render each member's tags the way #1323 pre-renders its user data: aws.buildTags on the member's LaunchConfig (built with buildLaunchConfigFromParams + applyIdleTimeoutDefault, as the foreground loop does). Ship them in the params, and have the Lambda add them to the instance TagSpecification, leaving spawn:ttl-deadline to the Lambda, which anchors it at the real launch time. That keeps the Lambda from needing a second tag builder. The remaining RunInstances fields (volume size, SGs, subnet/AZ, spot max price) need the same treatment or an explicit refusal.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions