Context
Follow-up (defense-in-depth) from the mysql readiness-race investigation whose root cause is already fixed in #90 / v0.9.29 (dockerReadyCheck no longer answers ready during the mysql:8.4 temporary-server phase). This issue is the secondary hardening item ranked #3 in that handover.
Problem
runPostCreateHooks (internal/cli/create.go:639, called at :178) fires each repository's post_create: line exactly once. For an engine-provider repo whose post_create connects to the DB over host TCP immediately after Up/ReadyCheck returns (e.g. make create-database → make migrate), a single transient failure kills that step with no recovery.
Even with a correct readiness check (post-#90), a heavily-loaded host can still surface a transient ERROR 2013 ... at 'handshake: reading initial communication packet', system error: 35 (EAGAIN) on the very first connection — docker-proxy/mysqld can momentarily fail to complete the handshake under load. Today that transient error is terminal for the affected post_create line.
Proposal
Add a small bounded retry (e.g. 3× with backoff) around each post_create line — or at least around a step that exits non-zero with a connection/handshake-class error — so first-run migrations are resilient to a single transient blip. Scope it narrowly (retry count + backoff as constants or per-engine tunables seeded by the constructor, not package-scope globals).
Notes
Context
Follow-up (defense-in-depth) from the mysql readiness-race investigation whose root cause is already fixed in #90 / v0.9.29 (
dockerReadyCheckno longer answers ready during the mysql:8.4 temporary-server phase). This issue is the secondary hardening item ranked #3 in that handover.Problem
runPostCreateHooks(internal/cli/create.go:639, called at:178) fires each repository'spost_create:line exactly once. For an engine-provider repo whosepost_createconnects to the DB over host TCP immediately afterUp/ReadyCheckreturns (e.g.make create-database→make migrate), a single transient failure kills that step with no recovery.Even with a correct readiness check (post-#90), a heavily-loaded host can still surface a transient
ERROR 2013 ... at 'handshake: reading initial communication packet', system error: 35(EAGAIN) on the very first connection — docker-proxy/mysqld can momentarily fail to complete the handshake under load. Today that transient error is terminal for the affectedpost_createline.Proposal
Add a small bounded retry (e.g. 3× with backoff) around each
post_createline — or at least around a step that exits non-zero with a connection/handshake-class error — so first-run migrations are resilient to a single transient blip. Scope it narrowly (retry count + backoff as constants or per-engine tunables seeded by the constructor, not package-scope globals).Notes