Repository navigation
fix(database): share pool with partial-index conformance worker - #183695
Conversation
Pass the parent PostgreSQL pool endpoints to the inline journal worker so the existing strict root guard does not fail after otherwise successful conformance tests. Keep all ordering assertions and production behavior unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR passes the parent PostgreSQL pool endpoints into the partial-index conformance worker. Example: Run the partial-index ordering conformance file against PostgreSQL 17.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this PR repairs a source-confirmed PostgreSQL conformance failure with a minimal change and no actionable findings; required PostgreSQL checks remain pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe conformance fixture invokes production database query owners in a worker; inherited endpoints connect that worker to the parent's PostgreSQL I/O services. flowchart TD
A[Conformance fixture] --> B[Parent pool owner]
B --> C[Transferred pool endpoints]
C --> D[Journal fixture worker]
D --> E[Production query owners]
E --> F[Shared PostgreSQL services]
F --> G[PostgreSQL database]
Technical reviewBest possible solution: Use the existing endpoint-transfer contract so the fixture shares its parent's pool while retaining strict root detection and all ordering assertions. Do we have a high-confidence way to reproduce the issue? The missing endpoints and resulting worker self-root path are visible in current main and match the reported failure; no target code was executed during this read-only review. Is this the best way to solve the issue? This is a small root-cause repair using the same pool owner and endpoint-transfer API as existing conformance workers, without weakening the detector or adding test scaffolding. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fd0106458369. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +4. Total +4 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 25, 2026, 12:18 PM ET / 16:18 UTC. |
|
Merged via squash.
|
The independent pool-inheritance repairs in #183675 and #183695 combined into a second allocation and a duplicate workerData property on main. Keep the outer pool so construction-failure cleanup owns the same endpoints that are transferred to the journal worker. Validation: targeted TypeScript owner check reproduces TS1117 before this repair and passes afterward; all ten SQLite/PostgreSQL partial-index tests pass without unhandled errors; scoped lint, formatting, and fresh review pass.
#183675 and #183695 both added an inherited Postgres pool to the partial-index conformance worker. The merged file declared the pool twice (the inner one shadowing the outer that the catch path closes) and passed it twice in workerData, failing tsgo (TS1117) and oxlint (no-shadow, duplicate key) on main.
|
@jalehman, coordinating the overlapping repairs here: e843be89e6d had already removed the inner pool allocation and duplicate key while preserving the outer pool and construction-failure cleanup. 502bf359417 then removed the remaining The child still needs that field alongside the transferred endpoints. I’m restoring exactly one field and retaining the outer pool and cleanup; the resulting file is byte-identical to the version that passed the TypeScript owner check and all ten SQLite/PostgreSQL conformance tests. I’ll recheck current main before the push to avoid another overlap. Update: 54c0e4dfa92 has restored the field. The remote main file is again byte-identical to the tested repair, so no additional correction was pushed. Thanks for catching and reverting the overlap. |
…claw#183695) Pass the parent PostgreSQL pool endpoints to the inline journal worker so the existing strict root guard does not fail after otherwise successful conformance tests. Keep all ordering assertions and production behavior unchanged.
The independent pool-inheritance repairs in openclaw#183675 and openclaw#183695 combined into a second allocation and a duplicate workerData property on main. Keep the outer pool so construction-failure cleanup owns the same endpoints that are transferred to the journal worker. Validation: targeted TypeScript owner check reproduces TS1117 before this repair and passes afterward; all ten SQLite/PostgreSQL partial-index tests pass without unhandled errors; scoped lint, formatting, and fresh review pass.
openclaw#183675 and openclaw#183695 both added an inherited Postgres pool to the partial-index conformance worker. The merged file declared the pool twice (the inner one shadowing the outer that the catch path closes) and passed it twice in workerData, failing tsgo (TS1117) and oxlint (no-shadow, duplicate key) on main.
What Problem This Solves
Fixes PostgreSQL conformance failing after all assertions pass because the partial-index fixture starts an undeclared PostgreSQL pool in its inline worker.
Related: #183443. Scheduled main run 40207264272, shard 2 passed all 43 infra files / 252 tests, then failed on
Undeclared PostgreSQL pool self-root: other thread 11.User Impact
No production behavior change. The non-null partial-index ordering fix, query-plan assertions, cleanup, and strict root detector remain unchanged. Production LOC delta: 0; test-only change: +5/-1.
Why This Change Was Made
The inline journal worker bypassed the usual conformance worker constructor and omitted the parent's pool endpoints. Opening its database therefore started four separate I/O services and published the undeclared-root event immediately; extra teardown cannot undo that event. Pass the existing pool endpoints and their transfer list at worker construction so the parent remains the sole pool owner.
Evidence
Linux reproduction uses Node 26.12.1 and CI's exact digest-pinned pgvector PostgreSQL 17 image, with the same extensions and
max_locks_per_transaction=512, on an isolated loopback port. The installed container engine is Podman. No production state is used.38753ff3, introduced fixture38753ff3+ this patch38753ff3^(4bbb8154), existing shard 2b6876e8e, focused filef67d68c3, focused filef67d68c3, full shard 2These are correctness runs, not performance measurements. The fixture does not exist at
38753ff3^(4bbb8154), so an exact single-file parent comparison is unavailable. Its existing PostgreSQL shard-2 control passed as shown above. The fixed full shard-2 replay also passed on the Linux rig, including its 48-file / 270-test infra group with no unhandled errors. Shard membership changes between revisions because the existing planner assigns by committed weights and file-size estimates; these whole-shard counts are correctness controls, not paired performance samples. CI run 40209943617 completed successfully on exact headf67d68c37bceb75a0e3d49c24efed4cdc1169eca, including PostgreSQL conformance 1/3, 2/3, and 3/3. Shard 2 took 21m04s including setup.Whole-shard command:
node scripts/test-database-conformance.mjs --engine postgres --connection <isolated-dsn> --shard 2/3 -- --maxWorkers=1. No Testbox/Crabbox lease was used.Focused command:
node scripts/test-database-conformance.mjs --engine postgres --connection <isolated-dsn> -- src/infra/database-engine/partial-index-ordering.conformance.test.ts --maxWorkers=1.Formatting, changed-file lint, and
git diff --checkpassed. Simplification pass retained only the existing endpoint API wiring. Independent subagent review (autoreview route unavailable) is clean at P0–P2; the configured review helper refused the requested provider route, and no configuration was changed.Expected post-deploy signal: no runtime metric change from this test-only fix; scheduled PostgreSQL conformance shard 2 should finish with zero undeclared-root errors while retaining its ordering checks. No schema changes, allowlist entries, or detector weakening.
Follow-up correction
The merge overlapped with #183675, which had independently landed the same pool inheritance plus construction-failure cleanup. The combined main tree contained a second pool allocation and a duplicate worker-data key. e843be89e6d removes those three duplicate lines while preserving the outer pool and its cleanup.
The corrected owner passes the TypeScript check (the combined tree failed with TS1117), all ten SQLite/PostgreSQL conformance tests without unhandled errors, scoped lint/format, and fresh isolated review. The repaired file was verified at the remote main tip.