Skip to content

The compose reconciler cannot survive recreating itself, so a change to its own service definition lands in two ticks rather than one

Id: TD-PPagop-26091103 · Status: open · Filed: 2026-09-11

lib/compose-reconcile.sh runs docker compose up -d --remove-orphans from inside a container that is itself a service of the project it is recreating (requirement 2.5a, the reconciler service in deploy/docker/compose.yaml). Compose recreates a service whose own config hash changed, so a merged compose change that touches the reconciler service’s own definition — its command, its image reference, its ceilings, its mounts — has Compose stop the very container running the command, killing up -d part-way through. The stack is then partly applied: some services recreated from the new file, some not, and no compose-reconciled event written, because the process that would have written it is gone.

It self-heals rather than wedging, which is why this is debt and not a bug: the replacement container’s first tick reads the same drift (or the same pending_apply marker, where the file had already been installed) and finishes what its predecessor started. The cost is one tick — five minutes — of a half-applied stack, and one missing event for the reconciliation that actually happened.

The fix considered and deferred for simplicity in the pull request that introduced the service: run the recreate in a detached short-lived sibling rather than in-process — docker run --rm the same image with the socket and the project directory, docker compose up -d there — so nothing Compose stops is the thing issuing the command. That costs a second container per apply and a second place the socket is handed over, which is why it was not taken up front while the service is new.

Noticed while building the reconciler; documented as-built in IMPLEMENTATION-PIPELINE-SPEC requirement 2.5a (“Two things it does not do”).

Migrated to https://github.com/Pullwright/agent-ops/issues/2024.