Open
Description
This ticket will hold research into graceful shutdown of st2actionrunner. This is in anticipation of adding a way through OS or otherwise to allow us to scale st2actionrunners based on some factor.
My initial research led me to this section of code where the st2actionrunner takes ownership of a scheduled action:
st2actionrunner takes ownership
The st2actionrunner abandon code is here:
st2actionrunner abandon code
The teardown for the parent process is here:
st2actionrunner teardown
We are probably going to create a custom heartbeat script that monitors the number of st2actionrunner processes on a vm to tell the autoscaler to wait until the work is done.
import boto3
response = client.record_lifecycle_action_heartbeat(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleActionToken='string',
InstanceId='string'
)