From efa2e1351378dfebe81be9cb1bc31a8707b2d90b Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 31 Aug 2026 01:01:00 +0200 Subject: [PATCH] The store's readiness is checked over TCP, not the socket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While the store initialises it runs a temporary server on the unix socket only, then stops it and starts the real one. A socket check sees that temporary server, the action exits happy, and the verify a moment later lands in the gap between the two and fails — reported as "the action ran without error and its own verify still fails", which is true and names nothing. Intermittent, so it read as a slow machine. Both the action's own loop and its verify now ask the same question, over the port the init phase deliberately does not open: an action and its verify asking different questions is an action that can succeed into a state its verify rejects. --- examples/substrate-first-node.lock | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/substrate-first-node.lock b/examples/substrate-first-node.lock index 8975944..3166a40 100644 --- a/examples/substrate-first-node.lock +++ b/examples/substrate-first-node.lock @@ -58,12 +58,16 @@ "ports": ["127.0.0.1:5432:5432"], "volumes": ["mesh-store-data:/var/lib/postgresql/data"] }, + // Over TCP, not the socket. While the store initialises it runs a temporary server on the + // socket ONLY, then stops it and starts the real one — so a socket check passes, the action + // exits happy, and the verify a moment later lands in the gap and fails. The action and its + // verify must ask the same question, or the action can succeed into a state verify rejects. { "id": "store-ready", "type": "action", "in": "mesh-store", - "command": ["sh", "-c", "for i in $(seq 1 180); do pg_isready -U postgres >/dev/null 2>&1 && exit 0; sleep 1; done; echo 'the store did not answer within 180s; its own last words follow'; pg_isready -U postgres; tail -n 20 /var/lib/postgresql/data/log/*.log 2>/dev/null; exit 1"], - "verify": ["pg_isready", "-U", "postgres"] + "command": ["sh", "-c", "for i in $(seq 1 180); do pg_isready -h 127.0.0.1 -U postgres >/dev/null 2>&1 && exit 0; sleep 1; done; echo 'the store did not answer within 180s; its own last words follow'; pg_isready -h 127.0.0.1 -U postgres; tail -n 20 /var/lib/postgresql/data/log/*.log 2>/dev/null; exit 1"], +"verify": ["pg_isready", "-h", "127.0.0.1", "-U", "postgres"] }, { "id": "inventory-database",