In case of a long-running TTP, the operator might want to stop the process in the middle.
This might be done by sending a SIGTERM signal to the ttpforge process.
This might be beneficial to perform the clean up procedures for all the steps executed successfully.
Basic Example
Consider the following TTP file
name: Create a secret file and sleep for a day
description: |
Emulates a TTP which might run for a long time
steps:
- name: Setup
inline: |
echo "cakeisalie!" > secret
cleanup:
inline: |
rm secret
- name: Sleep
inline: |
sleep 86400
When the ttpforge process is stopped via SIGINT or SIGTERM, the clean up for the first step is not performed which leaves an artifact.
Drawbacks
The clean up procedures might be faulty or take significant time to run. This might prevent ttpforge from exiting in corner-cases
Unresolved questions
Another option is to run clean up procedures even for the currently running step. This might be helpful in case when a new process is started on a remote host and ttpforge waits for some message from it. In case of shutting down, the remote process might be killed by the clean up procedure for this step.
Implementation PR
No response
Reference Issues
No response
Summary
In case of a long-running TTP, the operator might want to stop the process in the middle. This might be done by sending a SIGTERM signal to the ttpforge process. This might be beneficial to perform the clean up procedures for all the steps executed successfully.
Basic Example
Consider the following TTP file
When the ttpforge process is stopped via SIGINT or SIGTERM, the clean up for the first step is not performed which leaves an artifact.
Drawbacks
The clean up procedures might be faulty or take significant time to run. This might prevent ttpforge from exiting in corner-cases
Unresolved questions
Another option is to run clean up procedures even for the currently running step. This might be helpful in case when a new process is started on a remote host and ttpforge waits for some message from it. In case of shutting down, the remote process might be killed by the clean up procedure for this step.