loopbackio / loopbackio/loopback-connector-postgresql

PG DataSource Error handler throwing memory leak warning

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

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

bug
主要言語
JavaScript
スター
118
フォーク
184
平均マージ
1日 22時間
マージ済み PR(30日)
5

説明

Steps to reproduce

  • Add onError handler in DataSource for Loopback Connector Postgresql.
  • Use DataSource on frequent manner.
  • It should throw warnings like
    (node:80014) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Client]. Use emitter.setMaxListeners() to increase limit

(More details to reproduce the issue are provided in the README.md file in the sandbox repository)

Current Behavior

It doesn't remove the attached error event listeners while releasing the connection back to pool.

Expected Behavior

It should remove attached event listener before releasing connection back to pool.

Link to reproduction sandbox

https://github.com/vinod-hansda/loopback-pg-warning

Additional information

node -e 'console.log(process.platform, process.arch, process.versions.node)' :-
darwin arm64 18.20.6

npm ls --prod --depth 0 | grep loopback :-
npm warn config production Use --omit=dev instead.
loopback-pg@0.0.1 /Users/vinodhansda/Documents/GitHub/loopback-pg-warning
├── @loopback/boot@5.0.10
├── @loopback/core@4.0.10
├── @loopback/repository@5.1.5
├── @loopback/rest-explorer@5.0.10
├── @loopback/rest@12.0.10
├── @loopback/service-proxy@5.0.10
├── loopback-connector-postgresql@7.1.9

Related Issues

See Reporting Issues for more tips on writing good issues

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

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

はじめの一歩

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

調査の方向性

リンクされた sandbox とその README を使用して、PostgreSQL DataSource と onError ハンドラーで MaxListenersExceededWarning を再現します。次に、connector の connection-pool release path を調査します。完了の条件は、接続が pool に返される前に、繰り返し使用しても error listener が蓄積されなくなることです。

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

評価

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

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

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