fix: diagnose unavailable MySQL runtime providers#2116
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ENOENTas a genericprovider-unavailablediagnosticRoot cause
provisionMysqlDockerServicecaught the process spawn error from the Docker image/start path but discarded it, reducing every pre-start failure to{ code: \"provision-failed\" }. When thedockerexecutable was absent, the actionableENOENTcause therefore never reached managed runtime-service evidence.Two related lifecycle paths also needed correction:
ENOENT, keeping the CLI alive until the Docker pull timeout elapsed.waitForMysqlDatabasetreated all Docker execution failures as retryable, so readiness-timeENOENTwas eventually collapsed toreadiness-failed.The resulting structured diagnostic is:
{ "code": "provider-unavailable", "command": "docker", "cause": { "code": "ENOENT", "message": "Provider command executable was not found" } }The evidence is provider-neutral and bounded: it does not forward raw stderr, process environment values, or an unbounded host error message. The generic process executor now owns an unref'd timeout and clears it on both spawn errors and process close. Readiness retries ordinary command failures but immediately preserves provider-command
ENOENT.Tests
timeout 20s npx tsx tests/runtime-services.test.tsdocker execnpx tsx tests/external-mysql-runtime-service.test.tsnpx tsx tests/native-mariadb-runtime-service.test.tsnpm run buildgit diff --checkThe repository does not define a lint script; the workspace TypeScript build provides package typechecking.
MySQL remains fail-closed: an unavailable Docker provider still throws
RuntimeServiceProvisionError, and no SQLite substitution or fallback was added.Fixes #2006