[enhancement] AWS spot: re-provision on spot interruption instead of failing after 40m dial timeout

Open
#937 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
aws, go

Research direction

Start with the SSH readiness loop in pkg/provider/util/command/command.go and trace how AWS instance state and spot placement are handled in pkg/provider/aws/data/spot.go and the AWS provider actions. Compare the existing unbounded dial behavior with the proposed interruption detection and bounded recovery options. Done means an interrupted instance is reported or reprovisioned as described, with a bounded retry policy and coverage for that behavior.

Written by the indexing model from the issue text.

Description

Summary

When mapt provisions an AWS kind cluster with spot=true, there is no handling for spot interruptions. If AWS interrupts the instance, mapt cannot distinguish "instance is gone (interrupted)" from "instance is temporarily unreachable": the SSH readiness loop keeps dialing until the 40-minute remote timeout expires, and the run fails.

Verified absent in mapt v0.10 through v0.14.5 (checked 2026-10-15, incl. main).

Observed behavior
  • Run: mapt aws kind create --spot (as exposed by the tkn/infra-aws-kind.yaml Tekton task with spot=true)
  • On spot interruption, logs stay at:
    main-kind-readiness-... Dial N/inf failed: retrying
    for the full RemoteTimeout (40m), then the run exits failed
  • Every interruption costs a full 40-minute run and a failed pipeline, even on healthy infrastructure
Where
  • Readiness dial loop: pkg/provider/util/command/command.go — RemoteTimeout = "40m", DialErrorLimit: -1 (unbounded dial retries)
  • AWS spot placement/provisioning: pkg/provider/aws/data/spot.go and the AWS provider actions
Related, but not a fix for this gap

PR #898 (merged 2026-09-07, released in v0.14.5) fixed an EIP-association readiness bug that produced the same Dial N/inf failed: retrying signature when ec2:AssociateAddress failed. That fix is orthogonal: it does not handle interruption of an already-running spot instance.

Proposed direction (up to maintainers)

Detect the spot interruption (EC2 interruption notice / instance reaching terminated state) and re-provision: tear down the placement, request a new spot instance, re-run readiness. Bound it with a max re-provision attempt count so an interruption storm still fails fast.

Minimum viable change: when the instance ID is no longer running, stop dialing and fail immediately with a clear spot instance interrupted error instead of a 40m dial timeout. That alone converts an opaque timeout into an actionable failure and lets consumers (e.g. Tekton task retries) recover.

Why it matters

spot=true is a first-class provisioning mode (exposed by tkn/infra-aws-kind.yaml), and e2e CI pipelines rely on it for AWS kind clusters. Every interruption costs a full 40-minute failed run, and the only consumer-side recovery today is a full task retry. Re-provisioning upstream makes spot interruptions a non-event for CI consumers.

Reproduction

Interruptions are AWS-driven and cannot be triggered on demand; observed in e2e CI runs. Approximate repro: provision an AWS kind cluster with spot=true, and from another shell terminate the running EC2 instance (aws ec2 terminate-instances) while mapt is in the SSH-readiness phase. Mapt then dials the gone instance until the 40m timeout instead of re-provisioning.

Versions

Gap verified in v0.10 → v0.14.5; present on main as of 2026-10-15.

Dominant language
Go
Stars
26
Forks
41
Avg merge
3d 14h
Merged PRs (30d)
27

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from redhat-developer/mapt

All issues in redhat-developer/mapt

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.