This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 04afd601aee Restart crashed Breeze components under mprocs (#75585)
04afd601aee is described below
commit 04afd601aeeece4dc4dcff4b34a14f94e9ad1fc6
Author: Yuseok Jo <[email protected]>
AuthorDate: Tue Oct 27 13:39:29 2026 +0900
Restart crashed Breeze components under mprocs (#75585)
---
contributing-docs/mprocs/mprocs.yaml | 14 +++++-----
scripts/in_container/bin/generate_mprocs_config.py | 18 ++++++-------
.../in_container/test_generate_mprocs_config.py | 30 ++++++++++++++++++++++
3 files changed, 46 insertions(+), 16 deletions(-)
diff --git a/contributing-docs/mprocs/mprocs.yaml
b/contributing-docs/mprocs/mprocs.yaml
index 9565fff493c..d291c84ff70 100644
--- a/contributing-docs/mprocs/mprocs.yaml
+++ b/contributing-docs/mprocs/mprocs.yaml
@@ -22,37 +22,37 @@
procs:
scheduler:
shell: airflow scheduler
- restart: always
+ autorestart: true
scrollback: 100000
api_server:
shell: airflow api-server
- restart: always
+ autorestart: true
scrollback: 100000
triggerer:
shell: airflow triggerer
- restart: always
+ autorestart: true
scrollback: 100000
dag_processor:
shell: airflow dag-processor
- restart: always
+ autorestart: true
scrollback: 100000
shell:
shell: bash
- restart: always
+ autorestart: true
scrollback: 100000
# # Optional: Uncomment to enable Celery worker (requires CeleryExecutor)
# celery_worker:
# shell: airflow celery worker
- # restart: always
+ # autorestart: true
# scrollback: 100000
# # Optional: Uncomment to enable Flower (requires Celery)
# flower:
# shell: airflow celery flower
- # restart: always
+ # autorestart: true
# scrollback: 100000
diff --git a/scripts/in_container/bin/generate_mprocs_config.py
b/scripts/in_container/bin/generate_mprocs_config.py
index a092892551e..9c5d1efd7f2 100755
--- a/scripts/in_container/bin/generate_mprocs_config.py
+++ b/scripts/in_container/bin/generate_mprocs_config.py
@@ -58,7 +58,7 @@ def generate_mprocs_config() -> str:
procs["scheduler"] = {
"shell": scheduler_cmd,
- "restart": "always",
+ "autorestart": True,
"scrollback": 100000,
}
@@ -84,7 +84,7 @@ def generate_mprocs_config() -> str:
api_cmd = (
f"airflow api-server {api_host_arg} -d" if dev_mode else
f"airflow api-server {api_host_arg}"
)
- procs["api_server"] = {"shell": api_cmd, "restart": "always",
"scrollback": 100000}
+ procs["api_server"] = {"shell": api_cmd, "autorestart": True,
"scrollback": 100000}
else:
# Webserver (Airflow 2.x)
if get_env_bool("BREEZE_DEBUG_WEBSERVER"):
@@ -96,7 +96,7 @@ def generate_mprocs_config() -> str:
procs["webserver"] = {
"shell": web_cmd,
- "restart": "always",
+ "autorestart": True,
"scrollback": 100000,
}
@@ -108,7 +108,7 @@ def generate_mprocs_config() -> str:
procs["triggerer"] = {
"shell": triggerer_cmd,
- "restart": "always",
+ "autorestart": True,
"scrollback": 100000,
}
@@ -122,7 +122,7 @@ def generate_mprocs_config() -> str:
procs["celery_worker"] = {
"shell": celery_cmd,
- "restart": "always",
+ "autorestart": True,
"scrollback": 100000,
}
@@ -136,7 +136,7 @@ def generate_mprocs_config() -> str:
procs["flower"] = {
"shell": flower_cmd,
- "restart": "always",
+ "autorestart": True,
"scrollback": 100000,
}
@@ -159,7 +159,7 @@ def generate_mprocs_config() -> str:
]
edge_cmd = " && ".join(edge_cmd_parts)
- procs["edge_worker"] = {"shell": edge_cmd, "restart": "always",
"scrollback": 100000}
+ procs["edge_worker"] = {"shell": edge_cmd, "autorestart": True,
"scrollback": 100000}
# Dag Processor (conditional)
if get_env_bool("STANDALONE_DAG_PROCESSOR"):
@@ -171,13 +171,13 @@ def generate_mprocs_config() -> str:
procs["dag_processor"] = {
"shell": dag_proc_cmd,
- "restart": "always",
+ "autorestart": True,
"scrollback": 100000,
}
procs["shell"] = {
"shell": "bash",
- "restart": "always",
+ "autorestart": True,
"scrollback": 100000,
}
diff --git a/scripts/tests/in_container/test_generate_mprocs_config.py
b/scripts/tests/in_container/test_generate_mprocs_config.py
index 24b6179f9a4..60c63544fa2 100644
--- a/scripts/tests/in_container/test_generate_mprocs_config.py
+++ b/scripts/tests/in_container/test_generate_mprocs_config.py
@@ -19,6 +19,7 @@ from __future__ import annotations
import importlib.util
from pathlib import Path
+import pytest
import yaml
MODULE_PATH = Path(__file__).parents[2] / "in_container" / "bin" /
"generate_mprocs_config.py"
@@ -37,3 +38,32 @@ def test_quit_key_quits_immediately():
config = yaml.safe_load(module.generate_mprocs_config())
assert config["keymap_procs"] == {"<q>": {"c": "quit"}}
+
+
[email protected](
+ ("airflow_version", "web_process"),
+ [pytest.param("", "api_server", id="airflow-3"), pytest.param("2.11.0",
"webserver", id="airflow-2")],
+)
+def test_every_process_restarts_after_it_exits(monkeypatch, airflow_version,
web_process):
+ monkeypatch.setenv("USE_AIRFLOW_VERSION", airflow_version)
+ monkeypatch.setenv("INTEGRATION_CELERY", "true")
+ monkeypatch.setenv("CELERY_FLOWER", "true")
+ monkeypatch.setenv("STANDALONE_DAG_PROCESSOR", "true")
+ monkeypatch.setenv(
+ "AIRFLOW__CORE__EXECUTOR",
"airflow.providers.edge3.executors.edge_executor.EdgeExecutor"
+ )
+ module = load_module()
+
+ procs = yaml.safe_load(module.generate_mprocs_config())["procs"]
+
+ assert set(procs) == {
+ "scheduler",
+ web_process,
+ "triggerer",
+ "celery_worker",
+ "flower",
+ "edge_worker",
+ "dag_processor",
+ "shell",
+ }
+ assert {name: proc.get("autorestart") for name, proc in procs.items()} ==
dict.fromkeys(procs, True)