Skip to content

Connection hang on the server side after ended #2329

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

Open
zen0wu opened this issue Sep 2, 2020 · 0 comments
Open

Connection hang on the server side after ended #2329

zen0wu opened this issue Sep 2, 2020 · 0 comments

Comments

@zen0wu
Copy link

zen0wu commented Sep 2, 2020

Hello!

We're observing the following behavior on our servers:

  • We use pg-pool to connect to a load balanced pool of pgbouncer
  • Occasionally we see connections closed from our application, but still alive on pgbouncer side
  • This exhausted the server connections on pgbouncer machines and cause issue
  • The server connection linked to that pgbouncer connection shows it's waiting on ClientRead

This happens after we upgraded our pg from 7.4.3 to 8.3.0. And the following code stands out, which might be the cause.

3828aa86

In this commit, the Client.end() method is changed

  • Before it calls connection.end() even after destroying the stream
  • Now if there's an active query, it only destroys the stream and not end the connection

We haven't been 100% sure this is the root cause, but I wonder if this is an intentional change. Logically it seems to make sense to close that connection no matter what. Would love your thoughts on this, let me know if I have any missing context, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant