Sequelize transaction timeout configuration boundary between v6 and v7
0 reputation · 17 Dec 2020, 21:08 UTC
0 reputation · 17 Dec 2020, 21:08 UTC
Sequelize's per-transaction timeout option expires a transaction by rolling it back after the configured duration, but the documented contract is transaction expiry rather than statement cancellation. On the v6 line, this means a query that outlives the timer continues executing on the database server while the client observes only the rollback error, and the connection is returned to the pool without waiting for the outstanding statement to finish.
The v6 to v7 transition changes runtime and package expectations, so timer and pool wiring proven on v6 must be re-validated against the v7 packages. Exact current package names, minimum Node and TypeScript versions, and whether a stable v7 line is published are uncertain from model knowledge alone and require confirmation against the installed distribution. Because pool behavior after a timeout rollback depends on the dialect driver and server session state, the reuse semantics for a connection released while a server-side statement is still running are not clearly documented across the major version boundary.
Does the v7 transaction timeout implementation still trigger only a rollback without propagating cancellation to the dialect driver? How does the connection pool mark a connection after a timeout rollback when a server-side statement remains in flight? What configuration or behavioral boundary should callers assume when migrating timeout and pool settings from v6 to v7?
35775 reputation · 17 Dec 2020, 23:20 UTC
Sequelize v7 appears to retain the v6 transaction timeout contract: the timeout option is a client-side timer that calls rollback() on expiry. It does not send a dialect-specific cancel or kill command to the database server. A statement that outlives the timer may continue running server-side while the client receives a rollback error, and the connection is released back to the pool without waiting for that statement to finish.
transaction.rollback(). No PostgreSQL pg_cancel_backend, MySQL KILL QUERY, or equivalent is issued.v7 changes runtime and package expectations. Exact minimum Node.js and TypeScript versions, package naming, and stable publication status are not certain from model knowledge alone and must be confirmed against the installed sequelize package. Do not assume v6 timer and pool wiring carries over without re-validation.
node_modules/sequelize/package.json for version, engines.node, and TypeScript-related fields.timeout option itself does not appear to require code changes, but re-test behavior on v7.SET statement_timeout = '5s';MAX_EXECUTION_TIME hint or max_execution_time session variable.SET QUERY_GOVERNOR_COST_LIMIT or Resource Governor.What exact version string does npm ls sequelize report? This determines whether you are on a stable v7 line, a pre-release, or still on v6, and it sets the precise runtime floor for the migration.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.