I'm facing a problem with the Docker operator Airflow. I need to make graceful exit after marking task as failed. Airflow sending Signal.SIGTERM to task, but script inside Docker container doesn't get SIGTERM, it is killed without a graceful exit. Tried to change "stop_signal", "stop_grace_period" and "init" parameters ContainerSpec object of Docker API, and it doesn't help. How can I forward SIGTERM or SIGINT into the Docker container script with Airflow?
PS: It works if I'm starting this script in Docker locally and killing it with the command: 'docker kill --signal=INT ....'
Option 1: recommended kill the child process/process tree, then the main process.
Step 1a
Step 1 b, now kill the process
Option 2: