Skip to content

Commit 5e969eb

Browse files
authored
PINF-1150 stagger scheduler probes (#762)
1 parent 8a1e16e commit 5e969eb

5 files changed

Lines changed: 45 additions & 8 deletions

File tree

Chart.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: airflow
3-
repository: https://github.com/astronomer/apc-airflow/releases/download/oss-helm-chart/1.17.15-astro
4-
version: 1.17.15-astro
5-
digest: sha256:4abf65ee0264a6868ce05ca0bb2fffda73889c7a5847cc6e9049fbe13edf3bd3
6-
generated: "2026-07-21T18:37:22.732846-04:00"
3+
repository: https://github.com/astronomer/apc-airflow/releases/download/oss-helm-chart/1.17.16-astro
4+
version: 1.17.16-astro
5+
digest: sha256:8fc6aa597647cda9e6238cab6983f521595fe9397966e329346d8f1c97178996
6+
generated: "2026-08-06T12:36:53.398345-04:00"

Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# apiVersion v2 is Helm 3
22
apiVersion: v2
33
name: airflow
4-
version: 1.18.7
4+
version: 1.18.8
55
description: Helm chart to deploy the Astronomer Platform Airflow module
66
icon: https://airflow.apache.org/docs/apache-airflow/stable/_images/pin_large.png
77
keywords:
88
- astronomer
99
- airflow
1010
dependencies:
1111
- name: airflow
12-
version: 1.17.15-astro
13-
repository: https://github.com/astronomer/apc-airflow/releases/download/oss-helm-chart/1.17.15-astro
12+
version: 1.17.16-astro
13+
repository: https://github.com/astronomer/apc-airflow/releases/download/oss-helm-chart/1.17.16-astro

bin/generate_circleci_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import yaml
99
from jinja2 import Template
1010

11-
git_root_dir = next(iter([x for x in Path(__file__).resolve().parents if (x / ".git").is_dir()]), None)
11+
git_root_dir = next(iter([x for x in Path(__file__).resolve().parents if (x / ".git").exists()]), None)
1212
metadata = yaml.safe_load((git_root_dir / "metadata.yaml").read_text())
1313
kube_versions = metadata["test_k8s_versions"]
1414

tests/chart/test_airflow.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,30 @@ def test_apiServer_startup_initialDelaySeconds_defaults(self, kube_version):
171171
assert len(docs) == 1
172172
c_by_name = get_containers_by_name(docs[0])
173173
assert c_by_name["api-server"]["startupProbe"]["initialDelaySeconds"] == 30
174+
175+
def test_scheduler_readinessprobe_and_livenessprobe_defaults_do_not_fire_in_lockstep(self, kube_version):
176+
"""PINF-1150: readinessProbe and livenessProbe run the identical exec
177+
command (fork a process, import Airflow, round-trip the DB). If both fired
178+
on the same initialDelaySeconds/periodSeconds, kubelet would trigger them
179+
at the same instant every cycle, doubling the CPU/DB load from
180+
health-checking alone at that moment -- readiness has no more timeout
181+
headroom than liveness, so it would be the first to trip under contention.
182+
This asserts values.yaml's override keeps the two offset, so a future edit
183+
can't silently reintroduce the lockstep.
184+
"""
185+
docs = render_chart(
186+
kube_version=kube_version, show_only=["charts/airflow/templates/scheduler/scheduler-deployment.yaml"], values={}
187+
)
188+
189+
assert len(docs) == 1
190+
c_by_name = get_containers_by_name(docs[0])
191+
liveness = c_by_name["scheduler"]["livenessProbe"]
192+
readiness = c_by_name["scheduler"]["readinessProbe"]
193+
194+
assert liveness["timeoutSeconds"] == 30
195+
assert liveness["initialDelaySeconds"] == 10
196+
assert readiness["initialDelaySeconds"] == 40
197+
assert liveness["periodSeconds"] == readiness["periodSeconds"] == 60
198+
# Never coincide: the two schedules must not land on the same instant
199+
# modulo their shared period.
200+
assert (readiness["initialDelaySeconds"] - liveness["initialDelaySeconds"]) % liveness["periodSeconds"] != 0

values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ airflow:
5656
scheduler:
5757
livenessProbe:
5858
timeoutSeconds: 30
59+
# PINF-1150: readinessProbe and livenessProbe run the identical exec command
60+
# (fork a process, import Airflow, round-trip the DB). apc-airflow's own chart
61+
# defaults give both the same initialDelaySeconds/periodSeconds (10s/60s), so
62+
# without this offset they fire at the exact same instant every 60s, doubling
63+
# the CPU/DB load from health-checking alone at that moment -- readiness (the
64+
# smaller timeout of the two) is the one that trips first under contention.
65+
# 40s puts readiness exactly opposite liveness within the 60s cycle (10s and
66+
# 40s, 30s apart), so the two health checks never coincide.
67+
readinessProbe:
68+
initialDelaySeconds: 40
5969
strategy:
6070
type: Recreate
6171
affinity:

0 commit comments

Comments
 (0)