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
- Database record lock in workbench
- lock wating in nestjs application
- excute command pm2 restart different terminal
- lock clear(excute command is "ROLLBAKC") in workbench
- excute query in nestjs application
- 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
- Database record lock in workbench
- lock wating in nestjs application
- excute command pm2 restart different terminal
- lock clear(excute command is "ROLLBAKC") in workbench
- excute query in nestjs application
- 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.