Skip to content

Commit

Permalink
[AIRFLOW-2733] Reconcile psutil and subprocess in webserver cli
Browse files Browse the repository at this point in the history
  • Loading branch information
George Leslie-Waksman committed Sep 11, 2018
1 parent 2318cea commit e7e5a68
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions airflow/bin/cli.py
Expand Up @@ -922,9 +922,7 @@ def monitor_gunicorn(gunicorn_master_proc):
master_timeout = conf.getint('webserver', 'web_server_master_timeout')
restart_workers(gunicorn_master_proc, num_workers, master_timeout)
else:
while gunicorn_master_proc.poll() is None:
time.sleep(1)

gunicorn_master_proc.wait()
sys.exit(gunicorn_master_proc.returncode)

if args.daemon:
Expand Down Expand Up @@ -959,7 +957,7 @@ def monitor_gunicorn(gunicorn_master_proc):
stdout.close()
stderr.close()
else:
gunicorn_master_proc = subprocess.Popen(run_args, close_fds=True)
gunicorn_master_proc = psutil.Popen(run_args, close_fds=True)

signal.signal(signal.SIGINT, kill_proc)
signal.signal(signal.SIGTERM, kill_proc)
Expand Down

0 comments on commit e7e5a68

Please sign in to comment.