[
https://issues.apache.org/jira/browse/AIRFLOW-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16723487#comment-16723487
]
ASF GitHub Bot commented on AIRFLOW-1592:
-----------------------------------------
stale[bot] closed pull request #2595: [AIRFLOW-1592] Add --keep-alive option
for gunicorn to airflow config
URL: https://github.com/apache/incubator-airflow/pull/2595
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py
index 09bd0c1806..0f38cd3530 100644
--- a/airflow/bin/cli.py
+++ b/airflow/bin/cli.py
@@ -857,6 +857,7 @@ def webserver(args):
num_workers = args.workers or conf.get('webserver', 'workers')
worker_timeout = (args.worker_timeout or
conf.get('webserver', 'web_server_worker_timeout'))
+ keep_alive = (args.keep_alive or conf.get('webserver',
'web_server_keep_alive'))
ssl_cert = args.ssl_cert or conf.get('webserver', 'web_server_ssl_cert')
ssl_key = args.ssl_key or conf.get('webserver', 'web_server_ssl_key')
if not ssl_cert and ssl_key:
@@ -903,6 +904,7 @@ def webserver(args):
'-w', str(num_workers),
'-k', str(args.workerclass),
'-t', str(worker_timeout),
+ '--keep-alive', int(keep_alive),
'-b', args.hostname + ':' + str(args.port),
'-n', 'airflow-webserver',
'-p', str(pid),
diff --git a/airflow/config_templates/default_airflow.cfg
b/airflow/config_templates/default_airflow.cfg
index 0028d7832f..9e7ebe9271 100644
--- a/airflow/config_templates/default_airflow.cfg
+++ b/airflow/config_templates/default_airflow.cfg
@@ -239,6 +239,9 @@ web_server_master_timeout = 120
# Number of seconds the gunicorn webserver waits before timing out on a worker
web_server_worker_timeout = 120
+# Number of seconds for the gunicorn keep-alive
+web_server_keep_alive = 75
+
# Number of workers to refresh at a time. When set to 0, worker refresh is
# disabled. When nonzero, airflow periodically refreshes webserver workers by
# bringing up new ones and killing old ones.
diff --git a/tests/cli/test_cli.py b/tests/cli/test_cli.py
index aeafdd85fe..2eb509d5b9 100644
--- a/tests/cli/test_cli.py
+++ b/tests/cli/test_cli.py
@@ -75,6 +75,7 @@ def create_mock_args(
pickle=None,
raw=None,
interactive=None,
+ keep_alive=None,
):
if executor_config is None:
executor_config = {}
@@ -101,6 +102,7 @@ def create_mock_args(
args.ignore_dependencies = ignore_dependencies
args.force = force
args.interactive = interactive
+ args.keep_alive = keep_alive
return args
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Add keep-alive argument supported by gunicorn backend to the airflow
> configuration
> ----------------------------------------------------------------------------------
>
> Key: AIRFLOW-1592
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1592
> Project: Apache Airflow
> Issue Type: Improvement
> Reporter: Demian Ginther
> Assignee: Iuliia Volkova
> Priority: Minor
>
> The --keep-alive option is necessary for gunicorn to function properly with
> AWS ELBs, as gunicorn appears to have an issue with the ELB timeouts as set
> by default.
> In addition, it makes no sense to provide a wrapper for a program but not
> allow all configuration options to be set.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)