From be578ac13f2b6c24f9c0ae64bc6ab95b6548a394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TATSUNO=20=E2=80=9CTaz=E2=80=9D=20Yasuhiro?= Date: Fri, 11 Sep 2026 22:26:48 +0900 Subject: [PATCH] fix(mwaa): probe the metadata database over TCP before starting Airflow (#3406) The official postgres image serves first-boot init through a temporary server that listens only on the Unix socket, then restarts it. The readiness probe ran pg_isready over that socket, so it could pass against the temporary server before the final server accepted TCP connections from the Airflow container. Probe TCP loopback instead. --- .../floci/services/mwaa/MwaaEnvironmentManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/hectorvent/floci/services/mwaa/MwaaEnvironmentManager.java b/src/main/java/io/github/hectorvent/floci/services/mwaa/MwaaEnvironmentManager.java index a5a47ecc79..09d83953d9 100644 --- a/src/main/java/io/github/hectorvent/floci/services/mwaa/MwaaEnvironmentManager.java +++ b/src/main/java/io/github/hectorvent/floci/services/mwaa/MwaaEnvironmentManager.java @@ -425,11 +425,17 @@ public class MwaaEnvironmentManager { + "exec airflow webserver"; } + /** + * Probes over TCP loopback on purpose. The official image runs first-boot init against a + * temporary server that listens only on the Unix socket, so a socket probe can pass before + * the final server accepts the Airflow container's TCP connections. + */ private void waitForPostgresReady(String containerId) { Exception last = null; for (int attempt = 1; attempt <= 60; attempt++) { try { - ExecResult result = execInContainer(containerId, new String[]{"pg_isready", "-U", "airflow"}); + ExecResult result = execInContainer(containerId, + new String[]{"pg_isready", "-h", "127.0.0.1", "-U", "airflow"}); if (result.exitCode() == 0) { return; }