Fixed: airflow standalone Hangs at "Shutting down components" After Ctrl+C in Apache Airflow®
Most of the time, Ctrl+C stopped Apache Airflow® 3.4.0's airflow standalone in under a minute: Shutting down components, then Complete, and my prompt came back. Sometimes it stopped at Shutting down components and never finished. Here's what was still running, why it hangs, what I reported upstream, and how to end it until the fix is released.
What I Was Doing
I was running Airflow 3.4.0 on Python 3.14 with airflow standalone, in a terminal with the project's virtual environment active and AIRFLOW_HOME set. To stop it, I pressed Ctrl+C in that terminal.
What I Expected
standalone | Shutting down components, then standalone | Complete, and my prompt back. That's what happened on most stops.
What I Got
The output stopped after Shutting down components:
dag-processor | 2026-12-01T03:44:56.560583Z [info ] get next_dagrun_info_v2 [airflow.serialization.definitions.dag] last_automated_run_info=None loc=dag.py:491 next_info=None
dag-processor | 2026-12-01T03:44:56.560639Z [info ] setting next dagrun info [airflow.models.dag] loc=dag.py:887 next_dagrun=None next_dagrun_create_after=None next_dagrun_data_interval_end=None next_dagrun_data_interval_start=None next_dagrun_partition_date=None next_dagrun_partition_key=None
^Cstandalone | Shutting down components

^C is how the terminal shows the Ctrl+C. No Complete followed, and no prompt: the terminal stayed like this. It didn't happen every time. In about 30 stops, 4 hung, 3 of them while my computer was short of memory.
What I Checked
What was still running. I listed the processes of that airflow standalone from a second terminal. airflow standalone itself was still running, waiting, and so was its scheduler. The other components had exited.
Where the scheduler was stuck. The next time it hung, I sampled the stuck scheduler with macOS's sample tool, which shows where each thread of a running program is. These are the main thread's lines, filtered to the important ones:
time_sleep (in python3.14)
PyErr_CheckSignals (in python3.14)
_io_TextIOWrapper_flush (in python3.14)
_io__Buffered_flush (in python3.14)
_bufferedwriter_flush_unlocked (in python3.14)
PyErr_CheckSignals (in python3.14)
lock_PyThread_acquire_lock (in python3.14)
_PyMutex_LockTimed (in python3.14)
_PyParkingLot_Park (in python3.14)
_pthread_cond_wait (in libsystem_pthread.dylib)
__psynch_cvwait (in libsystem_kernel.dylib)
Read from the top: the scheduler was sleeping between two rounds of work (time_sleep) when Python checked for signals and ran a signal handler (PyErr_CheckSignals). That handler was writing a log line (flush) when Python checked for signals again and ran a second handler. The second handler asked for a lock (acquire_lock), and the thread has been waiting for it ever since (cvwait).
Which signals and which handler. Ctrl+C sends the signal SIGINT to every program started from that terminal. On top of that, airflow standalone asks each component to stop with terminate(), which sends a second signal, SIGTERM:
except KeyboardInterrupt:
pass
# Stop subcommand threads
self.print_output("standalone", "Shutting down components")
for command in self.subcommands.values():
command.stop()
for command in self.subcommands.values():
command.join()
self.print_output("standalone", "Complete")
def stop(self):
"""Call to stop this process (and thus this thread)."""
if self.process is not None:
self.process.terminate()
command.join() waits until each component has exited, so one component that never exits keeps Complete from ever printing. The scheduler handles both signals with _exit_gracefully, and the first thing it does there is write a log line:
self.log.info("Exiting gracefully upon receiving signal %s", signum)
sys.exit(os.EX_OK)
Why that log line waits forever. Airflow writes its log lines with structlog, a logging library, whose WriteLogger holds a lock while it writes and flushes each line:
def msg(self, message: str) -> None:
"""
Write and flush *message*.
"""
with self._lock:
self._write(message + "\n")
self._flush()
When a signal arrives while the scheduler is inside msg, writing any log line, the first handler's own included, the handler runs right there, with the lock already taken. Its own log line then waits for that lock, which the same thread holds and will never release. Python's logging documentation warns about exactly this: "lock implementations in the threading module are not always re-entrant, and so cannot be invoked from such signal handlers."
What more Ctrl+C presses do. To test what ends a hung airflow standalone, I made the hang happen on purpose, after a Dag had run so the executor had task workers. I paused airflow standalone until its scheduler was stuck writing a log line, then sent the stop signal; the upstream report below has the steps. Then I pressed Ctrl+C twice more:
standalone | Shutting down components
^CTraceback (most recent call last):
...
File ".../site-packages/airflow/cli/commands/standalone_command.py", line 135, in run
command.join()
~~~~~~~~~~~~^^
File ".../lib/python3.14/threading.py", line 1134, in join
self._os_thread_handle.join(timeout)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyboardInterrupt
^CException ignored while joining a thread in _thread._shutdown():
Traceback (most recent call last):
File ".../lib/python3.14/threading.py", line 1584, in _shutdown
_thread_shutdown()
KeyboardInterrupt:

The second press stopped airflow standalone's wait with a KeyboardInterrupt, but the prompt didn't come back. The third gave the prompt back. The stuck scheduler and dag-processor didn't stop, though: they kept running in the background with the task workers, no longer tied to that terminal.
Upstream. I reported it as apache/airflow#77848. A fix that stops logging inside the signal handlers, apache/airflow#77873, was open on 2026-12-04, under the milestone Airflow 3.4.2.
Why It Happens
When Ctrl+C's signal reaches the scheduler while it's writing a log line, its signal handler tries to write a log line too, and waits for a lock its own thread holds. The scheduler never exits, so airflow standalone waits for it forever. Whether the signal lands in the middle of a write is a matter of timing, which is why it happens only sometimes.
The Fix
The real fix is in Airflow's code. Until a release includes it, here's how to end a hung airflow standalone.
If it's still at Shutting down components, close that terminal window or tab. Closing a terminal sends the programs in it the hang-up signal, SIGHUP. The stuck components have no handler for it, so the system ends them. When I closed the terminal of a hung airflow standalone, every Airflow process ended.
If you already pressed Ctrl+C again and got your prompt back, closing the terminal no longer helps: the stuck processes aren't tied to it anymore. They still share one process group, the group of the airflow standalone they came from, so you can end them all through it. First, store the group's ID in a variable, in the same or any other terminal:
group=$(ps -o pgid= -p "$(pgrep -f -n "bin/airflow")" | tr -d ' ')
echo "$group"
96457
pgrep -f -n "bin/airflow"prints the process ID of the newest process whose command line containsbin/airflow: one of the stuck components, because each one runs as.venv/bin/airflowwith a command after it.ps -o pgid= -pwith that ID prints the ID of its process group, andtr -d ' 'removes the spacespsputs in front of it.group=$(...)stores the result in a shell variable calledgroup, andecho "$group"prints it.
List everything in that group:
pgrep -lf -g "$group"
96473 .../.venv/bin/python .../.venv/bin/airflow scheduler
96475 .../.venv/bin/python .../.venv/bin/airflow dag-processor
96495 .../.venv/bin/python -c from multiprocessing.resource_tracker import main;main(8)
96658 .../.venv/bin/python -c from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=9, pipe_handle=24) --multiprocessing-fork
96659 .../.venv/bin/python -c from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=9, pipe_handle=26) --multiprocessing-fork
96660 .../.venv/bin/python -c from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=9, pipe_handle=28) --multiprocessing-fork
-g "$group"picks the processes in that group, and-lfprints each one's full command line.
The last three are the executor's task workers, and the one before them is a helper of the scheduler. Their command lines don't contain bin/airflow, so only the group finds them. If you run another Airflow on the same computer, check that this list shows the stuck one's processes: pgrep -n picks the newest match, which could belong to the other one.
Now send the whole group the hang-up signal:
kill -HUP -- "-$group"
-HUPpicks SIGHUP, which the stuck components don't handle.- The minus sign in front of the group's ID makes
killsignal every process in the group, not one process. --tellskillthat-96457is not an option.
This ends only the processes in that group, so any other program you run is safe.
After the Fix
I listed the group again:
pgrep -lf -g "$group"
It printed nothing: every process of that airflow standalone was gone, the task workers included.

Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Pressing Ctrl+C again and again | The second press printed a KeyboardInterrupt traceback and no prompt. The third gave the prompt back, but the stuck processes kept running in the background, and closing the terminal no longer ended them | At the first hang, close the terminal. After extra presses, end the process group |
Ending the processes by name, such as with pkill -f "bin/airflow" | pgrep -fl "bin/airflow" listed only the scheduler and the dag-processor, not the task workers or the helper | End the process group, which holds all of them |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Shutting down components and no Complete after Ctrl+C | A component is stuck in its own signal handler | Close that terminal |
The prompt is back, but pgrep -fl "bin/airflow" lists Airflow processes | Extra Ctrl+C presses left the stuck processes running in the background | End their process group as in The Fix |
ps: Invalid process id, and echo "$group" prints an empty line | No process with bin/airflow in its command line is left | Nothing to end: don't run the kill line |
FAQ
Why doesn't it happen every time?
The signal has to arrive while the scheduler is writing a log line. Most of the time it arrives between writes, and the scheduler stops normally. A busy computer makes the bad timing more likely: 3 of my 4 hangs happened while mine was short of memory.
Do I need to change anything after the fix is released?
No. The fix changes Airflow's own code, so after upgrading, one Ctrl+C is enough again.
Conclusion
airflow standalone hung at Shutting down components because Ctrl+C's signal can reach the scheduler while it's writing a log line, and its signal handler then waits forever for a lock its own thread holds. Until the fix ships, close the terminal at the first hang. If the prompt already came back, end the stuck processes through their process group with kill -HUP -- "-$group".
Additional Resources
- apache/airflow#77848 — the report, with the steps that make the hang happen every time, and the fix linked from it.
- Python logging: Thread Safety — why logging from a signal handler can deadlock.
- Quick Start —
airflow standalone.
Related
Apache®, Apache Airflow and Airflow® are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.
