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
[ ] latest
[ ] @next
[x] 0.2.11 (or put your version here)
Hello,
We're running a NestJS app using typeorm to read/write data from a mysql (Aurora) instance. We're seeing an issue with what appears to be idle connections being used by the QueryRunner, and we encounter the following error:
QueryFailedError: Connection lost: The server closed the connection.
at new QueryFailedError (/usr/src/app/node_modules/typeorm/error/QueryFailedError.js:28:28)
at Query.<anonymous> (/usr/src/app/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:227:45)
at Query.<anonymous> (/usr/src/app/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/usr/src/app/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at /usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:396:18
at Array.forEach (<anonymous>)
at /usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:395:13
at process._tickCallback (internal/process/next_tick.js:61:11)
So far we haven't seen this issue when using repository.save or repository.update, we've only seen this from the calls that use a queryBuilder, such as
this.repo.createQueryBuilder('merchant').leftJoinAndSelect('merchant.profile','profile')....leftJoinAndSelect('merchant.orderRules','orderRules').addOrderBy('orderRules.index');.where('merchant.usageReportingScheduleBucket = :bucket',{ bucket }).andWhere('merchant.billingId is not null').getMany();
I'm wondering if this is potentially a bug where connections are being held open for too long, and only recycled when a connection error is encountered? From my understanding, the QueryRunner is supposed to create and use a dedicated connection, but that doesn't seem to be the case here? Are there any typeorm settings that we can configure differently to prevent encountering this error?
The text was updated successfully, but these errors were encountered:
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[x]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[ ]
latest
[ ]
@next
[x]
0.2.11
(or put your version here)Hello,
We're running a
NestJS
app usingtypeorm
to read/write data from amysql
(Aurora) instance. We're seeing an issue with what appears to be idle connections being used by theQueryRunner
, and we encounter the following error:So far we haven't seen this issue when using
repository.save
orrepository.update
, we've only seen this from the calls that use aqueryBuilder
, such asI'm wondering if this is potentially a bug where connections are being held open for too long, and only recycled when a connection error is encountered? From my understanding, the
QueryRunner
is supposed to create and use a dedicated connection, but that doesn't seem to be the case here? Are there anytypeorm
settings that we can configure differently to prevent encountering this error?The text was updated successfully, but these errors were encountered: