Skip to content

spawn resume: --max-concurrent has no quota-derived --max-concurrent-auto equivalent #494

Closed

Description

@scttfrdmn

Context

spawn launch --max-concurrent-auto (#492, shipped in v0.99.0) derives the parameter-sweep concurrency ceiling from the account's real AWS quota headroom instead of requiring the caller to already know it — closing a real gap where a fleet launch could hit an account's actual quota ceiling with zero prior warning.

spawn resume has the exact same class of gap and was deliberately left out of that PR as a follow-up (see spawn#493's description).

The gap

cmd/resume.go's --max-concurrent override is a plain user-typed int, same as launch's was before #492:

resumeCmd.Flags().IntVar(&resumeMaxConcurrent, "max-concurrent", 0, "Override max concurrent instances (0 = use original)")
...
if resumeMaxConcurrent > 0 {
    maxConcurrent = resumeMaxConcurrent
}

There's no --max-concurrent-auto equivalent — a caller resuming an interrupted sweep after hitting a quota wall has no way to ask spawn to re-derive a safe ceiling from current quota headroom; they have to guess a number themselves, same problem #492 fixed for the initial launch.

Why this should be an easier retrofit than #492 was

Unlike the initial launch path (which had to resolve region before it could even ask about quota), resume already has a resolved region on hand from the original launch:

  • Foreground path: state.Region is loaded from the local sweep-state file (loadSweepState).
  • Detached path (resumeSweepDetached): state.Region comes back from sweep.QuerySweepStatus against the persisted SweepRecord (pkg/sweep/detached.go's Region string field).

So resuming doesn't need the region-auto-detect dance launch's --max-concurrent-auto handling does — it can go straight to quota lookup once state is loaded.

Ask

Add --max-concurrent-auto to spawn resume, reusing resolveAutoMaxConcurrent/sweepQuotaCombos from cmd/launch_sweep_quota.go (#492) rather than reimplementing quota derivation. The param sets needed for sweepQuotaCombos are already available from the reloaded parameter file (foreground path) or would need to come from the sweep's stored params (detached path — check what QuerySweepStatus/the DynamoDB record exposes).

Mutually exclusive with --max-concurrent, matching the validation launch already has.

Related

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