pg-pubsub should subscribe to listeningClient.on('error')

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

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

評価

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

調査の方向性

packages/pg-pubsub/src/index.ts の 181 行目付近から始め、listeningClient と pgPool がどのように管理されているかを調べます。PostGraphile のサブスクリプション中に PostgreSQL バックエンドを終了して障害を再現し、その後、pg-pubsub がクライアントエラーを検出し、次の select 1 を待たずに再接続することを確認します。

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

説明

bug
Summary

If the server disconnects us; we will only know when the next select 1 runs:
https://github.com/graphile/graphile-engine/blob/9940895db5a35f218484620d610845201278611c/packages/pg-pubsub/src/index.ts#L181

We should catch this issue and reconnect earlier so we miss fewer events.

Steps to reproduce
  1. Set up a PostGraphile subscription.
  2. Terminate the PostgreSQL backend handling this subscription.
Expected results

pg-pubsub should reconnect quickly.

Actual results

pg-pubsub only notices when the next select 1 fails (up to 25 seconds later).

Possible Solution

client.on('error', () => {releaseClient(client); if (!pgPool.ending) setupClient()})

主要言語
JavaScript
スター
764
フォーク
128
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

graphile/graphile-engine のほかの issue

graphile/graphile-engine の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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