[BUG] ECS: a DAEMON service does not roll when its task definition changes
What happens
A DAEMON service does not roll when its task definition changes. UpdateService with a new task definition records a new deployment, but the tasks from the previous revision keep running and no replacement is ever launched.
reconcileDaemonService decides which tasks to keep purely by which ACTIVE container instances they cover. It never compares a task's deploymentId or taskDefinitionArn with the service's, so a task from a superseded revision holds its instance slot indefinitely.
Expected
As with REPLICA services: tasks on the new revision are started and the stale ones are stopped, so the service ends up running the task definition it reports.
Repro
- Register an EC2 cluster with one container instance, and a task definition
td:1. CreateServicewithschedulingStrategy=DAEMONandtd:1; wait for one RUNNING task.- Register
td:2andUpdateService --task-definition td:2. ListTasks/DescribeTasks: the only task is still ontd:1, however long you wait.
Note
The deployment-status work in #4694 counts every task a DAEMON service owns, stale or not, so that a DAEMON deployment still converges. That keeps main's behaviour, where the deployment reads as finished while the previous revision is what is running. Once DAEMON rolls, that special case should be removed.
Source: floci-io/floci