tortoise / tortoise-orm

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

ConnectionDoesNotExistError, connection was closed in the middle of operation #1598

Open Cheesy008 opened 2 months ago

Cheesy008 commented 2 months ago

Hello This exception rarely occures in our prod environment and I'm wondering if it's possible to fix it somehow, maybe by using some retry logic in queries. We use tortoise along with FastAPI. Our default configuration is 10 MIN/MAX database pool size and 2 uvicorn workers. I found the same issue https://github.com/tortoise/tortoise-orm/issues/134. That user created fork of this repo and tried to add logic with retry. Is this retry approach suitable for solving this problem?