Skip to content

Commit

Permalink
Warn on Webserver when using SQLite or SequentialExecutor (#1…
Browse files Browse the repository at this point in the history
…7133)

Context: https://lists.apache.org/thread.html/r07e83f2462f08c4a52f6428b771a07e067ce9272b6256dca470a87fc%40%3Cdev.airflow.apache.org%3E
Note: Red flashes are for errors, we shouldn't use that.
GitOrigin-RevId: cb6fdd7495c3888fff3a4553af75aaf22bf95fa7
  • Loading branch information
kaxil authored and Cloud Composer Team committed Oct 7, 2022
1 parent e857cae commit f34029a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions airflow/www/views.py
Expand Up @@ -512,6 +512,30 @@ def health(self):
)
def index(self):
"""Home view."""
unit_test_mode: bool = conf.getboolean('core', 'UNIT_TEST_MODE')

if not unit_test_mode and "sqlite" in conf.get("core", "sql_alchemy_conn"):
db_doc_page = get_docs_url("howto/set-up-database.html")
flash(
Markup(
"Usage of <b>SQLite</b> detected. It should only be used for dev/testing. "
"Do not use <b>SQLite</b> as metadata DB in production. "
"We recommend using Postgres or MySQL. "
f"<a href='{db_doc_page}'><b>Click here</b></a> for more information."
),
category="warning",
)

if not unit_test_mode and conf.get("core", "executor") == "SequentialExecutor":
exec_doc_page = get_docs_url("executor/index.html")
flash(
Markup(
"Usage of <b>SequentialExecutor</b> detected. "
"Do not use <b>SequentialExecutor</b> in production. "
f"<a href='{exec_doc_page}'><b>Click here</b></a> for more information."
),
category="warning",
)
hide_paused_dags_by_default = conf.getboolean('webserver', 'hide_paused_dags_by_default')

default_dag_run = conf.getint('webserver', 'default_dag_run_display_number')
Expand Down

0 comments on commit f34029a

Please sign in to comment.