uranusjr commented on code in PR #32102:
URL: https://github.com/apache/airflow/pull/32102#discussion_r1285367869
##########
airflow/cli/commands/webserver_command.py:
##########
@@ -422,11 +422,18 @@ def webserver(args):
run_args += ["airflow.www.app:cached_app()"]
- # To prevent different workers creating the web app and
- # all writing to the database at the same time, we use the --preload
option.
- # With the preload option, the app is loaded before the workers are
forked, and each worker will
- # then have a copy of the app
- run_args += ["--preload"]
+ reload_on_plugin_change = conf.getboolean("webserver",
"reload_on_plugin_change", fallback=False)
+ if not reload_on_plugin_change:
+ # To prevent different workers creating the web app and
+ # all writing to the database at the same time, we use the
--preload option.
+ run_args += ["--preload"]
+ if reload_on_plugin_change:
+ log.warning(
+ "reload_on_plugin_change prevents running gunicorn with the
--preload option. "
+ "With the preload option, the app is loaded before the workers
are forked, and each worker "
+ "will then have a copy of the app. reload_on_plugin_change may
cause IntegrityErrors during "
+ "webserver startup, so avoid using it in production."
+ )
Review Comment:
Does this mean this warning will pop up in production servers following the
advice and _deployed correctly_? That feels wrong…
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]