Repository navigation
fix: gate mempool_api on Fulcrum being healthy - #78
Conversation
Fulcrum opens its Electrum listener only after syncing to bitcoind (~40s). mempool_api depended on it with plain depends_on (started), hit ECONNREFUSED, and intermittently never recovered, so the mempool Esplora API wait in `start` timed out (~10% of runs). Add a TCP healthcheck to fulcrum and make mempool_api wait on service_healthy.
…alth A healthcheck-gated depends_on deadlocks `compose up`: Fulcrum listens only once bitcoind has blocks, and the orchestrator mines them after `up`.
arkana-ai-bot
left a comment
There was a problem hiding this comment.
Arkana review — docker/compose.base.yml
Small infra fix for a documented ~10% startup failure. No protocol-critical paths touched.
Approach is sound
Chaining wait-for-it.sh fulcrum:50001 --timeout=720 --strict before ./start.sh is the right call here. The inline comment explains the design choice well: Fulcrum's Electrum listener only opens after bitcoind has blocks, and blocks are mined by the orchestrator after compose up returns — so a Docker healthcheck + condition: service_healthy on depends_on would keep mempool_api unstarted at that moment and force a restart cycle anyway. The in-container wait absorbs the delay without extra container restarts.
--strict + --timeout=720 is consistent with the existing mariadb wait and appropriate for a slow first-boot.
One observation: PR body doesn't match the implementation
docker/compose.base.yml line 147-171 (fulcrum service block): no healthcheck: stanza was added to fulcrum, and mempool_api's depends_on still uses plain service_started for fulcrum (lines 197-199). The PR body says "Add a TCP healthcheck to fulcrum and make mempool_api wait on service_healthy" — that describes a different approach that wasn't implemented. The YAML comment correctly reflects what was actually done; the PR description should be updated (or a note added) so future readers aren't confused about why there's no Compose healthcheck on fulcrum.
Not a blocker — the code itself is clear and correct — but worth a squash-message or description edit before merge.
No cross-repo impact
This file is purely the regtest compose stack. No public API, type, proto, or SDK interface changes. Grepping other repo clones for consumers of fulcrum/mempool_api endpoints would find only test harnesses that benefit from this fix.
No changes required.
Fulcrum opens its Electrum listener only after syncing to bitcoind (~40s). mempool_api depended on it with plain depends_on (started), hit ECONNREFUSED, and intermittently never recovered, so the mempool Esplora API wait in
starttimed out (~10% of runs).Add a TCP healthcheck to fulcrum and make mempool_api wait on service_healthy.