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
[x] latest
[ ] @next
[x] 0.2.22 (or put your version here)
Steps to reproduce or a small repository showing the problem:
Create a connection of type 'Postgres' with pg version > "7.13.0"
Run a query (e.g. select pg_sleep(8))
Terminate the connection unexpectedly (e.g. disconnect from the DB side running the following SQL on your database from a different proccess)
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
where query ='select pg_sleep(8)';
The app crashes with error:
events.js:200
throw er; // Unhandled 'error' event
^
Error: Connection terminated unexpectedly
at Connection.<anonymous> (/typeorm_debug/node_modules/pg/lib/client.js:255:9)
at Object.onceWrapper (events.js:312:28)
at Connection.emit (events.js:223:5)
at Socket.<anonymous> (/typeorm_debug/node_modules/pg/lib/connection.js:133:10)
at Socket.emit (events.js:228:7)
at endReadableNT (_stream_readable.js:1185:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
Emitted 'error' event on Client instance at:
at connectedErrorHandler (/typeorm_debug/node_modules/pg/lib/client.js:202:10)
at Connection.<anonymous> (/typeorm_debug/node_modules/pg/lib/client.js:272:9)
at Object.onceWrapper (events.js:312:28)
[... lines matching original stack trace ...]
at processTicksAndRejections (internal/process/task_queues.js:81:21)
I guess that there is an error being emitted and not being caught.
Can a change in Typeorm prevent this?
Thanks
The text was updated successfully, but these errors were encountered:
This error is emitted from the databaseConnection in PostgresQueryRunner.ts. If you install an error event listener on that databaseconnection, the application doesn't crash(the transaction is also not rolled back, so the query failed without typeorm knowing about it...).
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[x]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[x]
0.2.22
(or put your version here)Steps to reproduce or a small repository showing the problem:
Create a connection of type 'Postgres' with pg version > "7.13.0"
Run a query (e.g.
select pg_sleep(8)
)Terminate the connection unexpectedly (e.g. disconnect from the DB side running the following SQL on your database from a different proccess)
The app crashes with error:
I guess that there is an error being emitted and not being caught.
Can a change in Typeorm prevent this?
Thanks
The text was updated successfully, but these errors were encountered: