Repository navigation
Description
Symptom
On spawn 0.118.0 (0359c93), relaunching an MPI job array under a name already used earlier the same day failed within 5 s for every member. Nothing launched; the drain correctly found nothing.
spawn launch gchp-spawn-smoke --count 2 --job-array-name gchp-spawn-smoke --mpi --efa ... (c8g.48xlarge, us-east-1)
job array launch failed (2/2 members):
gchp-spawn-smoke-0: terminal/IdempotentParameterMismatch at phase=launch-acked after 1 rung(s)
gchp-spawn-smoke-1: terminal/IdempotentParameterMismatch at phase=launch-acked after 1 rung(s)
The earlier launch was the #671 smoke at 2026-10-04 04:24Z. This one was at 23:01Z, about 18.5 h later, with different user-data.
Cause
cmd/launch_jobarray.go, in the member loop of reconcileArrayMembers:
intent, err := cohort.NewEntityIntent(mp.name, id, "g1", cohort.CohortID(jobArrayID), ..., "")The token argument is empty, so cohort's NewEntityIntent falls back to Token(cluster, string(id), string(gen)), which here is Token(<job-array-name>, <name>-<index>, "g1"). The per-launch jobArrayID (generateJobArrayID, which has the date and random suffix) is passed as the CohortID but is not part of the token. mpicohort.Actuator.Launch then sets cfg.ClientToken = intent.IdempotencyToken on RunInstances.
So two separate spawn launch invocations with the same --job-array-name send the same RunInstances ClientToken per index. Within EC2's token retention window:
- Parameters differ (new user-data, type, AZ, …) →
IdempotentParameterMismatch, and the whole cohort fails. This is what I hit. It's harmless, but confusing, and the retry advice ("verify withspawn instances list") points in the wrong direction. - Parameters identical → EC2 returns the original reservation instead of launching. If the first launch's instances are already terminated, spawn would get back dead instance IDs for a "successful" launch. If they're still running, two arrays share instances. I haven't reproduced this one; it follows from EC2's documented idempotency semantics.
Re-issuing a token is right within one launch: retries and AZ-fallback rungs of the same reconcile. It's wrong across launches.
Suggested fix
Include the per-launch jobArrayID in the token, e.g. cohort.Token(jobArrayID, string(id), "g1"), or pass it as the explicit token argument. Retries inside one reconcile keep a stable token, and separate launches get distinct ones. spawn array retry passes the original rec.ArrayID, so it would still regroup and stay idempotent against its own earlier attempt. That's worth a test, along with: two launches with the same name produce different tokens; a retry inside one reconcile produces the same token.
Workaround
Use a fresh --job-array-name per launch.
Confirmed working on 0.118.0 (hardware, for the #672 note)
2× c7g.large, --mpi, no EFA, gchp-spawn-plumb (first use of that name):
- Cohort assembled in 61 s, so --count/--mpi job arrays ship DOUBLE-gzipped user-data: cloud-init runs nothing, members never enroll, and the failed cohort leaves instances running #671's single gzip holds.
--commandstarted with/tmp/mpi-hostfilealready present and/run/spawn/required-gates=/run/spawn/mpi-ready(fix(bootstrap): make --command wait for storage and MPI setup #678).- Root ssh to the peer works (fix(mpi): distribute the cluster SSH key over SSM, and make the enrollment probe see mpirun #687).
mpirun -np 2 --hostfile /tmp/mpi-hostfile --map-by node hostnameprinted both hostnames.- Both members self-terminated via
--on-complete terminate. - spawn created
spawn-mpi-gchp-spawn-plumbitself.
Minor, same run: --ttl 30m renders in --estimate-only as TTL cost: $0.07 (0 hr × 2 instances). The dollar figure is right but the hours read 0; probably integer truncation in the formatter.
Activity
fix(mpi): find fi_info on the real EFA layout, and key the ClientToke…
fix(launch): give the job-array id real entropy (#710)
fix(launch): give the job-array id real entropy (#710) (#711)
chore(release): v0.121.0