fastify-postgres icon indicating copy to clipboard operation
fastify-postgres copied to clipboard

pg-pool force closing fastify instance

Open yukha-dw opened this issue 1 year ago • 5 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.x.x

Plugin version

5.2.2

Node.js version

18.x

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

22.04

Description

Hi, I just found out this weird behavior about pg-pool and it turned out a known issue on its repo. When we shutdown/restart PostgreSQL instance, this module will force close our Fastify app! As my understanding, this happens due to lack of error handler in pg-pool, resulting unexpected termination event when we wrap the query logic using try catch. Due to my poor explanation, please read this issue: https://github.com/brianc/node-postgres/issues/2439.

Steps to Reproduce

  1. Deploy PostgreSQL
  2. Deploy Fastify Instance with PostgreSQL support
  3. Shutdown PostgreSQL

Expected Behavior

No response

yukha-dw avatar Dec 26 '23 11:12 yukha-dw