Skip to content

feat: Configurable signal handlers to stop in-progress deployments#70

Closed
khvn26 wants to merge 1 commit intomainfrom
feat/stop-on-signals
Closed

feat: Configurable signal handlers to stop in-progress deployments#70
khvn26 wants to merge 1 commit intomainfrom
feat/stop-on-signals

Conversation

@khvn26
Copy link
Copy Markdown
Member

@khvn26 khvn26 commented Mar 25, 2026

  • Adds stopOnSignals configuration option to custom.deploymentSettings
  • When the Serverless process receives a configured signal (e.g. SIGTERM, SIGINT), the plugin queries CodeDeploy for in-progress deployments and stops them with autoRollbackEnabled: true
  • Enables cross-region rollback coordination when used with GitHub Actions fail-fast matrix strategy

Configuration

custom:
  deploymentSettings:
    stopOnSignals:
      - SIGTERM
      - SIGINT

How it works

  1. Plugin registers handlers for each configured signal in the constructor
  2. On signal receipt, it looks up the CodeDeploy application via CloudFormation
  3. Lists all in-progress/queued/ready deployments for that application
  4. Calls StopDeployment with auto-rollback on each (in parallel via Promise.all)
  5. Errors are caught and logged — best-effort, doesn't block process exit

Test plan

  • Unit tests for signal handler registration (configured, empty, missing)
  • Unit tests for stopInProgressDeployments (stops deployments, no deployments, API errors)
  • Integration test in staging: validate signal propagation with fail-fast: true and exec in CI

When the process receives a configured signal (e.g. SIGTERM, SIGINT),
the plugin queries CodeDeploy for in-progress deployments and stops
them with auto-rollback enabled. This enables cross-region rollback
coordination when used with GitHub Actions fail-fast matrix strategy.

Configurable via `custom.deploymentSettings.stopOnSignals` in
serverless.yml.
@khvn26 khvn26 force-pushed the feat/stop-on-signals branch from 3d5d192 to e5038f7 Compare March 25, 2026 18:38
@khvn26 khvn26 closed this Mar 26, 2026
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.

1 participant