Skip to content

Stop deploys from resetting the ECS task count set by the autoscaler - #601

Draft
chelseakr-exygy wants to merge 1 commit into
mainfrom
chelseakr-exygy/14017-ignore-desired-count
Draft

chelseakr-exygy wants to merge 1 commit into
mainfrom
chelseakr-exygy/14017-ignore-desired-count

Conversation

@chelseakr-exygy

Copy link
Copy Markdown
Member

Description

Every bin/deploy set the ECS service back to FARGATE_DESIRED_TASK_COUNT, draining tasks the autoscaler had added. The service now ignores later changes to desired_count, so the value only sets the starting count.

Behavior change: setting FARGATE_DESIRED_TASK_COUNT=0 and redeploying no longer shuts the server down. Use aws ecs update-service --desired-count <n>. The variable description is updated, and civiform-deploy's example config needs a follow-up.

This is a technical change to the deployment infrastructure only. There's no change to CiviForm itself and nothing for QA to test.

Code written with AI assistance (Claude), PR body written by human!

Checklist

General

  • Added the correct label
  • Assigned to a specific person or civiform/deployment-system
  • Created tests which fail without the change (if possible)
  • Performed manual testing (at a minimum run bin/setup without your changes and then bin/deploy with your changes to ensure your changes don't break existing deployments)
  • Extended the README / documentation, if necessary

Instructions for manual testing

Technical check for the deployment reviewer, not a QA task. Not yet run in AWS.

  1. bin/setup and bin/deploy on main with FARGATE_DESIRED_TASK_COUNT=1.
  2. Scale the service to 3: aws ecs update-service --cluster <cluster> --service <service> --desired-count 3.
  3. bin/deploy from this branch. The plan should show no desired_count change, and the service should stay at 3 tasks through the rollout.
  4. Set FARGATE_DESIRED_TASK_COUNT=2 and deploy again. No change should be proposed.
  5. Change a feature flag and deploy. The task count should not drop during the rollout.

Issue(s) this completes

Fixes civiform/civiform#14017

@chelseakr-exygy chelseakr-exygy added the bug Something isn't working label Oct 6, 2026
@chelseakr-exygy chelseakr-exygy self-assigned this Oct 6, 2026
@chelseakr-exygy
chelseakr-exygy marked this pull request as ready for review October 6, 2026 21:10
@chelseakr-exygy
chelseakr-exygy marked this pull request as draft October 6, 2026 21:12
@chelseakr-exygy

Copy link
Copy Markdown
Member Author

forgot to perform manual testing, stand by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ECS desired_count overrides autoscaler which can reduce capacity during an update

1 participant