Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(postgres): invalidate connection after client-side timeout (seque…
…lize#15144) * Invalidate connection after client-side timeout. The `query_timeout` feature of the `pg` package helps handle stuck TCP connections more quickly and gracefully by implementing a client-side timeout: brianc/node-postgres#1713 Sequelize started passing this dialect-specific option through to `pg` here: sequelize#13258 I believe we also want to invalidate the connection when a client-side timeout occurs. We shouldn't try to reuse the stuck connection because...it's stuck. This PR updates the error handling code so that the connection is invalidated if the error matches the one thrown from here: https://github.com/brianc/node-postgres/blob/5538df6b446f4b4f921947b460fe38acb897e579/packages/pg/lib/client.js#L529 * Add comment with link to PR. * Add tests, shorten comment. * Skip tests for postgres-native. * Update src/dialects/postgres/query.js Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com> Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
- Loading branch information