Skip to content

Commit 117bc40

Browse files
vishal-avHarness
authored andcommitted
[PIPE-30396] Task Abort Configuration for Local Execution (#100744)
* 37b763 addressed comments * 4d479d [PIPE-30396] Task Abort Configuration for Local Execution
1 parent 7ca97d9 commit 117bc40

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/platform/delegates-v2/install-delegate-2-0.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,35 @@ NAME="<your delegate name>"
581581
CLEANUP_GRACE_PERIOD_SECONDS=30
582582
```
583583
584+
### Task Abort Configuration for Local Execution
585+
586+
When a task runs directly on the delegate's host machine (such as a Run step without containers), subprocesses are started on the host to handle the task. When a stage is aborted or encounters an error, the delegate will clean up these subprocesses.
587+
588+
:::note
589+
This feature is only available on Unix-based platforms (macOS and Linux). For Windows, the process is terminated by invoking `taskkill.exe /t /f` directly (forceful kill).
590+
:::
591+
592+
You can control the cleanup behavior by configuring the following environment variables in the delegate's `config.env` file:
593+
594+
- `HARNESS_SUBPROCESS_KILL_PROCESS_GROUP_MAX_SIGTERM_ATTEMPTS` (non-negative integer, default: `1`): Specifies the number of SIGTERM signals sent to subprocesses before sending a SIGKILL.
595+
596+
- `HARNESS_SUBPROCESS_KILL_PROCESS_GROUP_RETRY_INTERVAL_SECS` (positive integer, default: `10`): Specifies the time (in seconds) between successive SIGTERM signals sent to the subprocesses.
597+
598+
#### Example config.env
599+
600+
To configure the delegate to send up to 3 SIGTERM attempts with a 15-second interval before forcefully killing subprocesses:
601+
602+
```
603+
ACCOUNT_ID="<ACCOUNT_ID>"
604+
TOKEN="<DELEGATE_TOKEN>"
605+
TAGS="<your delegate tags>"
606+
URL="<MANAGER_HOST_AND_PORT>"
607+
NAME="<your delegate name>"
608+
...
609+
HARNESS_SUBPROCESS_KILL_PROCESS_GROUP_MAX_SIGTERM_ATTEMPTS=3
610+
HARNESS_SUBPROCESS_KILL_PROCESS_GROUP_RETRY_INTERVAL_SECS=15
611+
```
612+
584613
### Configure Custom Working Directory
585614
586615
By default, the delegate stores its configuration files, logs, and cache in a standard location. You can customize this location using the `HARNESS_WORKDIR` variable.

0 commit comments

Comments
 (0)