From 21937f920fe8c52e329abc9fe5b0624670f0e2bc Mon Sep 17 00:00:00 2001 From: Artyom Date: Fri, 30 Oct 2026 09:04:09 +0300 Subject: [PATCH] Wait for S3 to turn healthy after the paused pass docker compose up --wait failed at once after unpausing S3: the probes that ran while it was paused had already marked it unhealthy. The demo now polls the health status of the container until it is healthy again. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27 --- scripts/reconcile_track.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/reconcile_track.py b/scripts/reconcile_track.py index 6095d0a2..3d43f91f 100644 --- a/scripts/reconcile_track.py +++ b/scripts/reconcile_track.py @@ -303,6 +303,16 @@ def single(check): ) +def healthy(service, seconds=90): + container = compose("ps", "-q", service).strip() + probe = ["docker", "inspect", "-f", "{{.State.Health.Status}}", container] + deadline = time.monotonic() + seconds + while must(probe).strip() != "healthy": + if time.monotonic() > deadline: + raise SystemExit(f"{service} is not healthy after {seconds} s") + time.sleep(1) + + def interrupt(check): name = f"lab4-reconcile-sigterm-{os.getpid()}" compose("pause", "s3") @@ -322,7 +332,7 @@ def interrupt(check): code = runner.wait(timeout=60) finally: compose("unpause", "s3") - compose("up", "-d", "--wait", "--no-deps", "s3") + healthy("s3") after = reconcile("--dry-run", *FLAGS) status, init = state.split() report = {