whoopscheckmate
whoopscheckmate

Reputation: 876

How to Properly Exit Airflow Standalone?

I am running airflow standalone as a local development environment. I followed the instructions provided by Airflow to setup the environment, but now I'd like to shut it down in the most graceful way possible.

I ran the standalone command in a terminal, and so my first attempt was to simply use Ctrl+C. It looks promising:

triggerer | [2022-02-02 10:44:06,771] {triggerer_job.py:251} INFO - 0 triggers currently running
^Cstandalone | Shutting down components

However, even 10 minutes later, the shutdown is still in progress, with no more messages in the terminal. I used Ctrl+C again and got a KeyboardInterrupt. Did I do this the wrong way? Is there a better way to shut down the standalone environment?

Upvotes: 4

Views: 1987

Answers (1)

Mark Moretto
Mark Moretto

Reputation: 2348

You could try the following (in bash):

pkill --signal 2 -u $USER airflow

or

pkill --signal 15 -u $USER airflow

or

pkill --signal 9 -u $USER airflow

Say what?

Here's more description of each part:

  • pkill - Process kill function.
  • --signal - Tells what 'signal' to send to the process
  • 2 | 15 | 9 - Is the id for the terminal signal to send.
    • 2 = SIGINT, which is like CTRL + C.
    • 15 = SIGTERM, the default for pkill.
    • 9 = SIGKILL, which doesn't messaround with gracefully ending a process.
    • For more info, run kill -L in your bash terminal.
  • -u - Tells the functon to only match processes whose real user ID is listed.
  • $USER - The current session user environment variable. This may be different on your system, so adjust accordingly.
  • airflow - The name of the selection criteria or pattern to match.

prep info page for more detail on the options available.

Upvotes: 1

Related Questions