From 7e5d5c77ee8eb724d4c85f745ee0ecb0036be2d3 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Mon, 20 Apr 2020 01:39:36 +0200 Subject: [PATCH] Fix case when the pidfile is empty during the pidfile check --- airflow/utils/process_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airflow/utils/process_utils.py b/airflow/utils/process_utils.py index 2e5b7e2928529b..1cc87e73e61f69 100644 --- a/airflow/utils/process_utils.py +++ b/airflow/utils/process_utils.py @@ -270,6 +270,8 @@ def check_if_pidfile_process_is_running(pid_file: str, process_name: str): if pid_lock_file.is_locked(): # Read the pid pid = pid_lock_file.read_pid() + if pid is None: + return try: # Check if process is still running proc = psutil.Process(pid)