Repository navigation
fix: await CDM instance discovery - #231
Conversation
Make OpenSearch instance discovery asynchronous, await all callers, and add regression coverage for pending discovery and HTTP error responses. Fixes #230 AI-Tool: Codex AI-Model: gpt-6.1-sol AI-Effort: not specified
atheurer
left a comment
There was a problem hiding this comment.
Approve — verified async discovery fix preserves startup ordering and correctly awaits all route callers. Fixes #230. Minor follow-up nit: cdm.js:getInstancesInfo leaks globals (inst_idx/url/resp); recommend adding let/const to avoid cross-call clobber with async yields.
|
SSH identity check: ✅ PASS — no auth/QUADS changes; existing Review summary: Startup now correctly awaits initial discovery before listen, and all 14 server.js call sites plus CLI entry points await getInstancesInfo. Non-2xx handling and new regression tests for pending/503 look good. Nit (non-blocking): cdm.js loop vars leak to global scope ( |
Use the same native fetch transport as the asynchronous CDM query path for OpenSearch index discovery. This avoids the remaining then-request transport failures observed after metric queries in the Crucible MCP integration job. Follow-up to perftool-incubator#231 AI-Tool: Codex AI-Model: gpt-6.1-sol AI-Effort: not specified
Summary
then-request.Root Cause
After CDM query requests became asynchronous,
getInstancesInfo()remained synchronous and callers did not await it. This allowed route handlers to use partially refreshed instance metadata and, in the Crucible MCP integration failure, caused a reachable OpenSearch instance to be marked offline. Subsequent/api/v1/runsrequests then returned no runs even though indexing and metric queries had succeeded.Validation
node --checkpasses for all modified JavaScript files.npm testpasses: 63 tests, 0 failures.Fixes #230
— AI-signed: Codex | model: gpt-6.1-sol | effort: not specified | contribution: implemented fix, tests, and PR description