Graceful Termination

By default, command task processes are stopped with a SIGKILL to end immediately when the task is timed out or cancelled.

In some cases, the command has external resources it needs to clean up, such as Terraform releasing a lock.

By setting terminate-grace-period-seconds, the process will be sent a SIGTERM signal and given time to clean up before being stopped with SIGKILL.

tasks:
  - key: gracefully-stoppable-task
    terminate-grace-period-seconds: 30
    run: ...

Background Processes

By default, background processes are given a terminate-grace-period-seconds of 10.

This can be set on a per-background-process basis, and disabled with 0. When disabled, the background process will be stopped with SIGKILL immediately.

- key: gracefully-stoppable-background-process
  background-processes:
    - key: process-with-external-resources
      terminate-grace-period-seconds: 30
      run: ...
  run: ...