nestjs / typeorm

TypeORM module for Nest framework (node.js) 🍇

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

auto db connection close problem When Execute Graceful shtudown with pm2

JuTiger-Lee opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

I'm doing Graceful Shutdown in pm2

test process

  1. Database record lock in workbench
  2. lock wating in nestjs application
  3. excute command pm2 restart different terminal
  4. lock clear(excute command is "ROLLBAKC") in workbench
  5. excute query in nestjs application
  6. excute error message "[TypeORMError: Connection is not established with mysql database" in nestjs application

I know why this problem occurs because nestjs lifecycle
but I think @nestjs/typeorm libary should db connection handling

I tried typeorm config keepConnectionAlive options to fix true
Is there a way that I don't know about?

Minimum reproduction code

notthing

Steps to reproduce

  1. Database record lock in workbench
  2. lock wating in nestjs application
  3. excute command pm2 restart different terminal
  4. lock clear(excute command is "ROLLBAKC") in workbench
  5. excute query in nestjs application
  6. excute error message "[TypeORMError: Connection is not established with mysql database" in nestjs application

Expected behavior

I think @nestjs/typeorm libary should db connection handling

Package version

9.0.0

NestJS version

9.0.0

Node.js version

v18.19.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Thank you for taking the time to submit your report! From the looks of it, this could be better discussed on our Discord. If you haven't already, please join here and send a new post in the #⁠ 🐈 nestjs-help forum. Make sure to include a link to this issue, so you don't need to write it all again. We have a large community of helpful members, who will assist you in getting this to work.