← Back to Pull requests

Fix execProtocolRawSync spin after backend exit #1081

Open
unknown opened this pull request with 144 lines diff across 1 files
View on GitHub
unknown unknown commented on Aug 14, 2026 08:43 UTC
Author

작업 배경

execProtocolRawSync swallowed exceptions from the Postgres WASM main loop unless they matched the database error longjmp sentinel. When the backend exited or crashed mid-message, the input offsets stopped advancing and the synchronous loop retried forever at 100% CPU.

티켓 및 링크

  • GH-1058
  • 작업 내용

  • Rethrow ExitStatus, RuntimeError, and other exceptions outside the known longjmp recovery path.

  • Preserve the original protocol error when cleanup also fails, while always restoring the host process.exitCode.

  • Add bounded child-process regressions for backend exit with and without an open transaction, synthetic runtime failure, cleanup failure, and child cleanup.

  • Add a patch changeset for @electric-sql/pglite.
  • 테스트

  • pnpm --dir packages/pglite exec vitest run tests/exec-protocol-backend-exit.test.ts tests/exec-protocol.test.ts --reporter=verbose

  • pnpm --dir packages/pglite exec vitest run tests/basic.test.ts --testNamePattern='restores process.exitCode' --reporter=verbose

  • pnpm --dir packages/pglite typecheck

  • pnpm --dir packages/pglite stylecheck
  • Diff: 144 lines (+108 / -36) across 1 files Reviewer: Boulea7 Review duration: 137183m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 144 lines diff across 1 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.298
    Real PR Conversation Timeline
    1 comments
    "Review active on #1081"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.8% (MEDIUM) · Higher = larger blast radius
    39.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.0% · Safe to merge
    22.0%