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

fix(postgres): invalidate connection after client-side timeout #15283

Merged
merged 4 commits into from
Nov 15, 2022

Commits on Nov 15, 2022

  1. fix(postgres): invalidate connection after client-side timeout

    Merge ff43e8d from main:
    
    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
    harrykao committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    8f249a4 View commit details
    Browse the repository at this point in the history
  2. fix syntax error

    harrykao committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    f5300ff View commit details
    Browse the repository at this point in the history
  3. fix another syntax error

    harrykao committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    5e4b161 View commit details
    Browse the repository at this point in the history
  4. fix import

    harrykao committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    61c6e00 View commit details
    Browse the repository at this point in the history