Skip to content

fix(task): Spot→on-demand fallback keeps storage and flush hook (#1144) - #1191

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1144-fallback-options
Oct 19, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1144-fallback-options

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

The Spot to on-demand retry in spawn task run called launcher.Provision with an empty launcher.Options{}, dropping StorageScript and TaskFlushScript. A fallback instance came up without its EFS/FSx/volume mounts and without the terminal-flush hook that writes a completion record on a TTL kill.

Change: both attempts go through a new provisionTask helper (cmd/task.go) that forwards the same Options to each call; runTaskReal builds the Options once.

Gates (cmd/task_fallback_options_test.go):

  • TestProvisionTask_FallbackKeepsOptions: a recording fake Provision fails the Spot attempt with InsufficientInstanceCapacity; asserts two calls, Spot then on-demand, both with Options DeepEqual to the input, and cfg.Spot cleared. Watched failing against a compiling revert (retry passing launcher.Options{}): "Provision call 1 got Options {... StorageScript: ... TaskFlushScript:}".
  • TestTaskGo_ProvisionForwardsSeamOptions: discovers every launcher.Provision invocation in cmd/task.go (fails if none found) and requires each to sit inside a func literal and pass that literal's Options parameter. Watched failing against a compiling revert where the closure passes launcher.Options{} instead of its parameter. A revert to the original two direct calls also fails it (not inside a closure).
  • TestProvisionTask_NoFallbackNoRetry: no fallback configured means one attempt and the error surfaces.

Checks: make check passes through step 6; step 7 check-build-tags fails identically on unmodified main on this machine (/private/tmp path issue). semgrep scan --config=auto --error . clean. No help text changed. Not run on AWS.

Fixes #1144

@scttfrdmn scttfrdmn added this to the v0.136.0 milestone Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/task.go 63.63% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

The on-demand retry in task run passed an empty launcher.Options{}, so a
fallback instance launched without its EFS/FSx/volume mounts and without
the terminal-flush hook. Route both attempts through provisionTask, which
forwards one Options to each, and gate it with a recording fake plus an
AST check that task.go's only launcher.Provision forwards the seam's
Options.

Fixes #1144
@scttfrdmn
scttfrdmn force-pushed the fix/1144-fallback-options branch from 7d05def to c7bf5cb Compare October 19, 2026 22:31
@scttfrdmn
scttfrdmn merged commit b956179 into main Oct 19, 2026
8 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1144-fallback-options branch October 19, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

task run Spot→on-demand fallback drops StorageScript and TaskFlushScript

1 participant