Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Does pg-cursor return empty result even on network error?

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
javascript, node.js, postgresql
領域
backend, databases

調査の方向性

ドキュメント化された pg-cursor API から始め、示されている next() ループを cursor.read(min) まで追跡し、特に接続クローズとデッドロックのエラーパスを確認します。可能であれば高負荷のケースを再現し、空の結果が有効な終了マーカーなのかエラーなのかを明らかにします。動作と必要な処理を検証できれば完了です。

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

説明

As per this link https://node-postgres.com/apis/cursor , cursor will return empty result so we can stop.

But we have found that under huge load, when postgres closes connection or throws an error due to deadlock, cursor returns empty result. This happens rarely and out of 100 thousand of transactions, approx 20 to 80 transactions fail when cursor returns empty results, but results are sure there.

This occurs only under huge load. Under moderate or low load, everything works fine.

    async *next(min = 100) {

        const connection = await this.connection.getConnection(this.signal);
        const q = toQuery(this.command);
        const cursor = this.cursor = connection.query(new Cursor(q.text, q.values));
        do {
            const rows = await cursor.read(min);
            yield *rows;
            if (rows.length === 0) {
                break;
            }
        } while (true);
    }

Do I need to add error handler here as well?

Unfortunately I cannot create a stressed environment that results in similar situation.

主要言語
JavaScript
スター
13.2k
フォーク
1.4k
平均マージ
6日 15時間
マージ済み PR(30日)
6

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

brianc/node-postgres のほかの issue

brianc/node-postgres の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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