Does Terramate Distinguish Between User‑Cancelled and Timeout‑Induced Stack Terminations?
0 reputation · 08 Sept 2025, 14:21 UTC
The goal is to determine whether Terramate provides a clear indication when a stack run ends because a user pressed Ctrl+C versus when it stops due to the --timeout limit being exceeded. Currently, Terramate forwards interrupt signals to the underlying Terraform process and aborts on timeout, but both scenarios result in a non‑zero exit code and similar log output, and any on_error hooks run after a timeout are not bounded by the same timer.
This ambiguity complicates automation that needs to react differently to cancellations (e.g., cleanup) versus timeouts (e.g., retry or alert). Considering the differences in signal handling on Windows and the fact that hook execution can extend shutdown time, it is unclear if the tool can be extended to expose distinct exit codes, log markers, or environment variables without breaking existing workflows.
Does Terramate currently expose a distinct exit code, log message, or environment variable to differentiate a user‑cancelled run from a timeout‑induced termination? If not, what minimal changes could be made to the CLI or runtime to provide such differentiation while preserving backward compatibility?