Repository: incubator-airflow Updated Branches: refs/heads/master 53b89b983 -> 926c62837
[AIRFLOW-2671] Monitor gunicorn process, and exit if it exits Closes #3545 from NielsZeilemaker/monitor_webserver Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/926c6283 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/926c6283 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/926c6283 Branch: refs/heads/master Commit: 926c6283791864ff5098b647d51a0c7de0de0ea9 Parents: 53b89b9 Author: niels <[email protected]> Authored: Mon Jun 25 19:46:28 2018 +0100 Committer: Kaxil Naik <[email protected]> Committed: Mon Jun 25 19:46:28 2018 +0100 ---------------------------------------------------------------------- airflow/bin/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/926c6283/airflow/bin/cli.py ---------------------------------------------------------------------- diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py index 32ee483..e32b033 100644 --- a/airflow/bin/cli.py +++ b/airflow/bin/cli.py @@ -844,9 +844,11 @@ def webserver(args): master_timeout = conf.getint('webserver', 'web_server_master_timeout') restart_workers(gunicorn_master_proc, num_workers, master_timeout) else: - while True: + while gunicorn_master_proc.poll() is None: time.sleep(1) + sys.exit(gunicorn_master_proc.returncode) + if args.daemon: base, ext = os.path.splitext(pid) ctx = daemon.DaemonContext(
