You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeORM becomes unresponsive after this code is run 10x #4866
After running this 10x, (presumably the size of the default connection pool), TypeORM stops responding to all queries. On the 11th run, this code awaits forever and other code which uses Model.findOne(), etc. also locks.
Edit: After reading the docs more carefully, it turns out I was missing a call to runner.release() and this behavior was entirely appropriate!
If anyone comes across this, I think I'm going to wrap my code into a function like this that binds the runner to a nested scope, ensuring it is not possible to forget the release. It's hard to identify that this is a problem in development because it doesn't cause issues until the 10th execution.
Reacted by trexguo, Mikhail Korobkov, Rogerio de Oliveira, Andy Ogzewalla, maxrks, Kishore Newton, choco, noe132, Nikita Tsigelnikov, Kookheon Kim and 11 more
Im facing the same issue. Im using nestjs/mysql, im running a trasaction, but afer 8,9 o 10 request becomes unresponsive.
Im releasing the query runner too.
Activity
bengotow commentedon Oct 6, 2019
Edit: After reading the docs more carefully, it turns out I was missing a call to
runner.release()and this behavior was entirely appropriate!If anyone comes across this, I think I'm going to wrap my code into a function like this that binds the runner to a nested scope, ensuring it is not possible to forget the release. It's hard to identify that this is a problem in development because it doesn't cause issues until the 10th execution.
roger-oliver commentedon Oct 26, 2020
It helped me a lot mate! Thanks!
denes16 commentedon Mar 12, 2022
Im facing the same issue. Im using nestjs/mysql, im running a trasaction, but afer 8,9 o 10 request becomes unresponsive.
Im releasing the query runner too.
denes16 commentedon Mar 12, 2022
My code looks like this
fix: release newly created runner when no runner provided
fix: release newly created runner when no runner provided in DbQueryR…