pglite-socket: keep an extended-query batch on one connection until Sync

オープン
#1,192 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
node.js, postgresql, typescript
領域
backend, databases

調査の方向性

Start by reading the @electric-sql/pglite-socket 0.2.17 source for QueryQueueManager and processQueue, then inspect the related work in issues #1046 and #977. Reproduce the interleaving and queue-stall cases with concurrent pg pools, and check how the proposed batch handling affects disconnect cleanup and transaction ownership. Done means a regression test covers the reported failures and the maintainers have chosen an approach.

索引モデルが issue の本文から書いたものです。

説明

This is a fix proposal for #1046. The problem is still present in @electric-sql/pglite-socket 0.2.17.

  1. QueryQueueManager gives the backend to another handler after each message. Two clients that send Parse/Bind/Execute batches can interleave, which gives 08P01 (protocol violation) and 34000 (invalid cursor).
  2. When processQueue throws, it returns without clearing processing, so the queue stops for good.

Change we run locally (patched 0.1.5 since 2026-10-26):

  • A handler keeps the backend until its batch reaches Sync. Transaction ownership stays as it is.
  • On disconnect, the cleanup syncs an unfinished batch, rolls back its transaction, and releases queued connections.
  • processing is cleared in finally.

This fixed concurrent HTTP 500s with 08P01 and 34000 from pg pools in our test suite. The simple-query COPY limitation is unchanged. #977 covers part of this. Which approach do you want? We can port the change to the 0.2.17 source and add a regression test with two concurrent pg pools.

主要言語
TypeScript
スター
16.3k
フォーク
474
平均マージ
23時間 53分
マージ済み PR(30日)
53

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

electric-sql/pglite のほかの issue

electric-sql/pglite の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。