Repository navigation
test(postgres): inherit pool in partial-index plan worker - #183675
Conversation
Pass the parent PostgreSQL pool endpoints to the eval worker, matching conformance worker ownership. Close setup ports if worker construction fails. Unmodified main reproduces an undeclared pool self-root after all 10 tests pass; patched PostgreSQL conformance exits 0 with 10/10 tests and no unhandled errors. Focused typecheck, lint and format pass.
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR passes the parent PostgreSQL pool endpoints into the partial-index conformance worker and closes them if worker construction fails. Example: Run the partial-index conformance suite against disposable PostgreSQL 17.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a concrete conformance-worker ownership defect still present on main. The focused change reuses the existing pool contract, and no actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe conformance test launches an eval worker that exercises journal database owners; inherited MessagePorts connect its SQL client to the parent's existing PostgreSQL I/O services. flowchart LR
A[Conformance test] --> B[Existing pool owner]
B --> C[Transferred child endpoints]
C --> D[Journal eval worker]
D --> E[PostgreSQL I O services]
E --> F[Disposable PostgreSQL]
D --> G[Plans and assertions]
Technical reviewBest possible solution: Use the existing pool endpoint owner for this eval worker while preserving admission checks, assertions, and cleanup. Do we have a high-confidence way to reproduce the issue? Source confirms that main omits the inherited pool and therefore reaches independent pool creation; the author reports a matching before/after PostgreSQL run, which this read-only review did not execute. Is this the best way to solve the issue? The patch is the smallest complete repair: it uses existing endpoint creation and transfer helpers, preserves the guard, and releases newly created ports on construction failure. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f199f0208d0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +5. Total +5 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, 11:47 AM ET / 15:47 UTC. |
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.
…83675) Pass the parent PostgreSQL pool endpoints to the eval worker, matching conformance worker ownership. Close setup ports if worker construction fails. Unmodified main reproduces an undeclared pool self-root after all 10 tests pass; patched PostgreSQL conformance exits 0 with 10/10 tests and no unhandled errors. Focused typecheck, lint and format pass.
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.
Summary
High Level TLDR
The PostgreSQL partial-index conformance test launches an eval worker without the parent pool. Once the self-root guard is active, all assertions pass but the test process still fails. Pass the existing pool endpoints into that worker.
Root Cause
readJournalPlanscreates a raw worker instead of the shared conformance worker helper. It omittedworkerData.postgresPooland its transfer-list ports. The child starts an undeclared independent pool, and the main-thread guard throwsUndeclared PostgreSQL pool self-root: other thread 12.Verification
Real behavior proof
On unmodified main baseline
d754f7c3ae79e50de4471c60cfb115665bd9db45, run the partial-index conformance test against a disposable PostgreSQL 17 pgvector instance:node scripts/test-database-conformance.mjs --engine postgres --connection "$TEST_DATABASE_URL" -- src/infra/database-engine/partial-index-ordering.conformance.test.tsBefore: 10 tests passed, then the undeclared self-root error; process exit 1.
After: 10/10 passed, no unhandled errors; process exit 0.
Focused infra-test TypeScript check, oxlint and oxfmt passed. Independent review found no actionable defects. The guard stays enabled. Setup ports are closed if Worker construction fails. Existing SQLite behavior is preserved.
What was not tested
The entire PostgreSQL shard was not rerun locally. No production databases or real credentials were used.