Graceful delegate shutdown
Read about the process of graceful delegate shutdown.
Harness Delegate is designed to shut down gracefully.
Shutdown without upgrade
The process of graceful delegate shutdown without upgrade is as follows:
The delegate receives an instruction to quit.
A grace period begins during which the delegate:
Stops accepting new tasks.
Works to complete running tasks.
The grace period ends.
Delegates that have not quit are force-terminated.
Incomplete tasks are discarded.
Shutdown with upgrade
The process of graceful delegate shutdown with upgrader is as follows:
When
upgraderupdates the delegate image, it starts a new delegate and waits for a heartbeat and healthy state.When the delegate is connected,
upgraderterminates the old pod. However, the old pod will not be terminated immediately. It will firstStop accepting new tasks.
Wait for currently executing tasks to finish before terminating. The maximum time
upgraderwaits for tasks to finish before force-termination is 10 minutes.
Grace period
DELEGATE-LEGACY: END OF SUPPORT (EOS)
The length of the grace period is configurable.
Delegate type
Grace period
Default interval
Immutable image
Yes
Configurable (details below)
Legacy image
No
30 seconds
Configure the default interval for a Kubernetes deployment
Open the delegate manifest file and locate the container spec (spec.containers). Change the terminationGracePeriodSeconds as shown in the following YAML. In the example below, terminationGracePeriodSeconds is set to 10 minutes.
Configure the default interval for an Amazon ECS deployment
Open the delegate manifest file and locate the container containerDefinitions. Change the stopTimeout as shown in the following JSON. In the example below, stopTimeout is set to 10 minutes.
Configure the default interval for a Docker deployment
For Docker deployments, you use the docker stop command to set the default interval. In the example below, the interval is set to 10 minutes.
Graceful shutdown events
The event that initiates the graceful shutdown depends on delegate type.
Delegate environment
Trigger
Kubernetes
Pod termination, eviction, or user-initiated scaling
Docker
docker stop command
Shell
./stop.sh instruction
Last updated
Was this helpful?