---
title: "ECS SpotInterruption during a deploy: Fargate Spot or the release? | Proofline"
description: "A SpotInterruption stop during a deploy is reclaimed capacity; capacityProviderName, startedAt and startedBy show if the release was involved too."
url: https://proofline.sh/learn/ecs-fargate-spot-interruption-or-release/
---

[Learning center](/learn/)

# ECS SpotInterruption during a deploy: Fargate Spot or the release?

A SpotInterruption stop during a deploy is reclaimed capacity; capacityProviderName, startedAt and startedBy show if the release was involved too. Fargate Spot runs tasks on spare capacity and takes it back with a two-minute warning, so a rollout on Spot can lose tasks from either deployment for reasons that have nothing to do with the new revision.

Capacity overruns The Proofline team November 22, 2026 6 min read

## The signature and its nearby causes

The rollout loses tasks, the running count dips, and some stopped tasks carry stop code `SpotInterruption`. The current API lists both `SpotInterruption` and `TerminationNotice` among the seven stop codes. AWS's 2023 Fargate guide showed a Spot interruption event with stop code `TerminationNotice` and the reason `Your Spot Task was interrupted.`, and AWS's current troubleshooting page is written for `SpotInterruption`. Group both codes together until a task's reason says otherwise. [Task fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Task.html) · [SpotInterruption errors](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/spot-interruption-errors.html) · [Fargate capacity providers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-capacity-providers.html)

AWS's troubleshooting page says the error occurs when no Fargate Spot capacity is available or when Fargate takes back Spot capacity; on EC2 the equivalent is Spot Instances that are unavailable or reclaimed. That gives three readings of the same code during a deploy:

-   **An old task reclaimed.** A task from the previous deployment is interrupted. It explains a dip in running count, and nothing about the release.
-   **A new task reclaimed after it ran.** A task from the new deployment reached `RUNNING` and was interrupted. The interruption is still capacity, and the new revision's health is unknown from this task.
-   **A new task that never got capacity.** A task from the new deployment has no `startedAt` because no Spot capacity was available to start it. The rollout slows, and the revision is not implicated.

Stop codes that do point at the release, such as `TaskFailedToStart` with a reason naming the revision's image or secret, `EssentialContainerExited`, or a health check failure, need their own reading. The [stop code guide](/learn/ecs-task-stop-codes/) sorts them.

## Separate the stopped tasks by capacity and deployment

List the service's stopped tasks and read, for each one, the stop code, the capacity provider that ran it, the deployment that started it, and whether it ever ran. `startedBy` holds the deployment ID for a service task, and `capacityProviderName` names the provider, such as `FARGATE` or `FARGATE_SPOT`. Stopped tasks remain visible for at least an hour. [Task fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Task.html) · [Stopped task errors](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/stopped-task-errors.html)

```
aws ecs list-tasks \
  --profile PROFILE --region REGION --cluster CLUSTER \
  --service-name SERVICE --desired-status STOPPED \
  --query 'taskArns' --output json --no-cli-pager

aws ecs describe-tasks \
  --profile PROFILE --region REGION --cluster CLUSTER --tasks TASK_ARN_1 TASK_ARN_2 TASK_ARN_3 \
  --query 'tasks[].{deployment:startedBy,definition:taskDefinitionArn,capacity:capacityProviderName,az:availabilityZone,started:startedAt,stopping:stoppingAt,stopped:stoppedAt,code:stopCode,reason:stoppedReason,containers:containers[].{name:name,exit:exitCode}}' \
  --output json --no-cli-pager
```

Then read the service's deployments and capacity provider strategy, so you know which deployment ID is new and how many tasks the strategy puts on Spot. A strategy's `base` places a minimum number of tasks on one provider first, and `weight` splits the rest. [CapacityProviderStrategyItem](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html) · [Deployment fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Deployment.html)

```
aws ecs describe-services \
  --profile PROFILE --region REGION --cluster CLUSTER --services SERVICE \
  --query 'services[0].{strategy:capacityProviderStrategy,deployments:deployments[].{id:id,status:status,definition:taskDefinition,strategy:capacityProviderStrategy,running:runningCount,failed:failedTasks,rollout:rolloutState}}' \
  --output json --no-cli-pager
```

`capacityProviderStrategy` is omitted when the service uses a launch type instead of a strategy. [Service fields](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Service.html)

## What each result means

| Stop code | `capacity` | `deployment` | `started` | Reading |
| --- | --- | --- | --- | --- |
| `SpotInterruption` or `TerminationNotice` | `FARGATE_SPOT` | Old | Set | Capacity reclaimed from the old revision; not the release |
| `SpotInterruption` or `TerminationNotice` | `FARGATE_SPOT` | New | Set | Capacity reclaimed from the new revision; judge the release on its other tasks |
| `SpotInterruption` | `FARGATE_SPOT` | New | Empty | No Spot capacity to start the task; not the release |
| Any other code | `FARGATE` or `FARGATE_SPOT` | New | Either | Read that code; the capacity provider does not explain it |

The last row matters most during an incident. When a deploy fails and some tasks were also interrupted, the interruptions are easy to blame. Read the new deployment's tasks whose stop code is not a Spot code: those are the evidence about the release.

## An illustrative rollout, two outcomes

This fictional fixture follows the service `orders`, with 6 tasks and a strategy of `FARGATE` with `base` 2 and `FARGATE_SPOT` with weight 1. Deployment `ecs-svc/2211` replaces `orders:57` with `orders:58` at 10:00.

| Time | Deployment | Capacity | Stop code | `started` | Reason |
| --- | --- | --- | --- | --- | --- |
| 10:03 | `ecs-svc/1987` (old) | `FARGATE_SPOT` | `SpotInterruption` | 08:12 | `Your Spot Task was interrupted.` |
| 10:04 | `ecs-svc/2211` | `FARGATE_SPOT` | `SpotInterruption` | 10:01 | `Your Spot Task was interrupted.` |
| 10:06 | `ecs-svc/2211` | `FARGATE_SPOT` | `SpotInterruption` | empty | A reason about Spot capacity |

In this outcome, every stop is capacity. One old task and one new task were reclaimed after they ran, and one new task could not get Spot capacity at all. The new revision's other tasks are healthy, and the rollout completes once capacity returns. Rolling back would change nothing, since the old revision runs on the same Spot capacity.

In the second outcome, the same 10:03 interruption appears, but the new deployment's other tasks stop with `EssentialContainerExited` and exit code 1. The interruption is incidental. The new revision starts and crashes, and its container logs are the next read; the [exit code guide](/learn/ecs-exit-codes-after-deploy/) covers that reading.

## Make interruptions cheaper, and confirm

An interrupted task gets a two-minute warning, sent as a task state change event to EventBridge and as `SIGTERM` to the running task. A service then tries to launch replacement tasks on Fargate Spot if capacity is available; AWS's current page adds that Fargate does not replace Spot capacity with on-demand capacity. [Fargate capacity providers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-capacity-providers.html) · [SpotInterruption errors](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/spot-interruption-errors.html)

These are changes to consider:

-   **Handle `SIGTERM`.** The container must catch the signal to clean up. After `stopTimeout`, which defaults to 30 seconds and can be at most 120 seconds on Fargate, the task receives `SIGKILL`, which AWS warns may result in data loss or corruption. [Container stop timeout](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html) · [Spot termination notices](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-capacity-providers.html)
-   **Keep a floor on on-demand capacity.** A `base` on the `FARGATE` provider keeps that many tasks off Spot, so an interruption during a rollout cannot take the service below it. [CapacityProviderStrategyItem](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html)
-   **Check architecture support.** The current API states that Fargate Spot supports Linux x86\_64 tasks on platform version 1.3.0 or later and ARM64 tasks on 1.4.0 or later. Windows containers on Fargate don't support Fargate Spot, according to the 2023 guide. [CapacityProviderStrategyItem](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html)

To confirm on the next rollout, run the same `describe-tasks` query on every stopped task. Each Spot-coded task should be on `FARGATE_SPOT`, the new deployment should have no stopped task with any other code, and `rolloutState` should reach `COMPLETED`.

## Where the reading stops

The stop code says why ECS stopped the task, not how the new revision would have behaved had it kept running. A deployment whose new tasks were all interrupted has no evidence about the release yet; wait for tasks that run long enough to pass health checks. Stopped tasks expire after about an hour, so a slow investigation should rely on task state change events retained through an EventBridge rule. Stopped-reason text can change, so key on the stop code and the capacity provider. [Task state change events](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_task_events.html) · [The signature table](/learn/aws-deployment-failure-signatures/)

## Questions

### What is the difference between SpotInterruption and TerminationNotice in ECS?

Both are stop codes in the current ECS API, and the API does not define them separately. AWS's 2023 Fargate guide showed a Spot interruption with `TerminationNotice`, and its current troubleshooting page covers `SpotInterruption`, so treat both as reclaimed capacity and read the stopped reason for detail.

### How much warning does a Fargate Spot task get?

Two minutes. ECS sends a task state change event to EventBridge and `SIGTERM` to the task, then `SIGKILL` after the container's `stopTimeout`, which is at most 120 seconds on Fargate.

### Should I roll back a deployment because tasks were interrupted on Fargate Spot?

Not on the interruptions alone. The old revision runs on the same Spot capacity. Read the new deployment's tasks with other stop codes; if there are none and the running tasks are healthy, the release has given you no reason to roll back.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Which ECS task stops came from your deployment? Read the stop code](/learn/ecs-task-stop-codes/)
    
    Deployment failures The Proofline team November 22, 2026 6 min read
    
-   ### [ECS EssentialContainerExited after a deploy: read the exit code](/learn/ecs-exit-codes-after-deploy/)
    
    Deployment failures The Proofline team November 22, 2026 7 min read
