Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When "dialectOptions" has "query_timeout" for postgresql dialect - Connection terminated unexpectedly error apear #14116

Open
2 of 7 tasks
mmfKupl opened this issue Feb 15, 2022 · 0 comments
Labels
dialect: postgres For issues and PRs. Things that involve PostgreSQL (and do not involve all dialects). type: bug

Comments

@mmfKupl
Copy link

mmfKupl commented Feb 15, 2022

Issue Creation Checklist

[x] I have read the contribution guidelines

Bug Description

create PostgreSQL connection with following options:

{
   dialectOptions: {
       statement_timeout: 10,
   }
}

then when run next code

await sequelize.query('select * from tableName', { type: QueryTypes.RAW });

"Query read timeout" appeared immidiatly.
But then after 30s - 1m next error appears and destroys my server:

Error: Connection terminated unexpectedly
    at Connection.<anonymous> (/home/administrator/front/projects/datasource/node_modules/pg/lib/client.js:132:73)
    at Object.onceWrapper (events.js:420:28)
    at Connection.emit (events.js:314:20)
    at Connection.EventEmitter.emit (domain.js:483:12)
    at Socket.<anonymous> (/home/administrator/front/projects/datasource/node_modules/pg/lib/connection.js:108:12)
    at Socket.emit (events.js:326:22)
    at Socket.EventEmitter.emit (domain.js:483:12)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

What do you expect to happen?

I expect no error!

Environment

  • Sequelize version: 6.12.4
  • Node.js version: v12.22.3
  • If TypeScript related: TypeScript version: 3.9.7
  • node_postgres pg@8.5.1

Bug Report Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s): PostgrSQL
  • I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
@ephys ephys added dialect: postgres For issues and PRs. Things that involve PostgreSQL (and do not involve all dialects). type: bug labels Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialect: postgres For issues and PRs. Things that involve PostgreSQL (and do not involve all dialects). type: bug
Projects
None yet
Development

No branches or pull requests

2 participants