tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.68k stars 390 forks source link

Database connection was not released causing a new request to be pending #1438

Open GardenChan opened 1 year ago

GardenChan commented 1 year ago

Describe the bug When some abnormality occurs in the database connection, the connection will not be released back to the connection pool normally, and new requests will not be able to get the connection. This is a fatal problem. Looking forward to it being resolved.

To Reproduce It can be reproduced by disconnecting the connection in use. After the connection is disconnected, the program will report an error, resulting in the connection not being released normally. But the size of the connection pool is limited, so new connections will not be created. New requests will wait for connections.

Expected behavior If the database connection encounters an unexpected situation during use, it is necessary to ensure that the connection is released back to the connection pool normally.