Skip to content

test(postgres): inherit pool in partial-index plan worker - #183675

Merged
VACInc merged 1 commit into
mainfrom
fix/postgres-partial-index-pool-inheritance
Oct 25, 2026
Merged

VACInc merged 1 commit into
mainfrom
fix/postgres-partial-index-pool-inheritance

Conversation

@VACInc

@VACInc VACInc commented Oct 25, 2026

Copy link
Copy Markdown
Member

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

readJournalPlans creates a raw worker instead of the shared conformance worker helper. It omitted workerData.postgresPool and its transfer-list ports. The child starts an undeclared independent pool, and the main-thread guard throws Undeclared 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.ts

Before: 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@VACInc
VACInc enabled auto-merge (squash) October 25, 2026 15:37
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The reported run passes 10 assertions but exits 1 after an undeclared pool self-root error.
  • After: The reported patched run passes all 10 tests and exits 0 without unhandled errors.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, correct repair with concrete reported PostgreSQL before/after results and no findings; broader PostgreSQL CI is still running.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored test repair is outside the ordinary contributor proof gate; its body reports the changed conformance command against real disposable PostgreSQL with failure before and successful process completion after.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: PostgreSQL conformance reports failure after its assertions pass because a fixture worker starts an undeclared independent pool.
Reason: This maintainer-authored repair restores the existing shared-pool invariant without changing product defaults, configuration, schemas, or assertions.

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
Reviewed head: d134b257ec015773050299eeaeb18811d907a1b1

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Partial-index journal eval worker keeps the original intent (38753ff: Exercise real journal-owner statements and verify indexed ordering without changing their mutation ownership.)
  • PostgreSQL conformance pool inheritance keeps the original intent (b378654: Share four PostgreSQL I/O services through inherited direct client endpoints instead of starting independent per-worker pools.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b378654 adds src/infra/database-engine/conformance.test-support.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b378654d5e8d; files: src/infra/database-engine/conformance.test-support.ts)

PR surface

Tests +5. Total +5 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 6 1 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 6 1 +5

Labels

Label changes:

  • add P2: A focused test-infrastructure defect causes PostgreSQL conformance to fail despite passing assertions; production behavior is unchanged.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A focused test-infrastructure defect causes PostgreSQL conformance to fail despite passing assertions; production behavior is unchanged.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 25, 2026, 11:47 AM ET / 15:47 UTC.

@VACInc
VACInc merged commit a830e2e into main Oct 25, 2026
168 of 170 checks passed
@VACInc
VACInc deleted the fix/postgres-partial-index-pool-inheritance branch October 25, 2026 16:29
steipete added a commit that referenced this pull request Oct 25, 2026
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.
jalehman added a commit that referenced this pull request Oct 25, 2026
#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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant