Jason Yan
2010-07-23 23:45:21 UTC
I'm seeing an issue with how Psycopg 2.2.x handles connections with
PgBouncer. After a connection is closed, PgBouncer spits out the
following:
2010-07-23 16:33:46.407 5282 LOG C-0x1e9ad80:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:33306 login successful: db=test user=postgres
2010-07-23 16:33:46.407 5282 LOG S-0x1eb8280:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:5432 new connection to server
2010-07-23 16:33:46.411 5282 LOG C-0x1e9ad80:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:33306 closing because: client close request
(age=0)
2010-07-23 16:33:46.411 5282 LOG S-0x1eb8280:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:5432 closing because: unclean server (age=0)
This kills PgBouncer's server backend which effectively kills
connection pooling. I've reproduced this behavior with both 2.2.1 and
2.2.2, but I've verified that 2.0.14 does not have this issue. I'm
running a clean build of PgBouncer 1.3.3 with the default
configuration on Ubuntu 9.04 64-bit with the following PostgreSQL
packages:
ii postgresql 8.3.11-0ubuntu9.04
object-relational SQL database
(supported ve
ii postgresql-8.3 8.3.11-0ubuntu9.04
object-relational SQL database, version
8.3
ii postgresql-client-8.3 8.3.11-0ubuntu9.04
front-end programs for PostgreSQL 8.3
ii postgresql-client-common 97
manager for multiple PostgreSQL client
versi
ii postgresql-common 97
PostgreSQL database-cluster manager
ii postgresql-contrib-8.3 8.3.11-0ubuntu9.04
additional facilities for PostgreSQL
And the small test script that I'm reproducing the issue with:
import psycopg2
connection = psycopg2.connect("dbname=test user=postgres
host=localhost port=6432")
cursor = connection.cursor()
cursor.execute("SELECT 1")
connection.close()
Thanks,
Jason
PgBouncer. After a connection is closed, PgBouncer spits out the
following:
2010-07-23 16:33:46.407 5282 LOG C-0x1e9ad80:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:33306 login successful: db=test user=postgres
2010-07-23 16:33:46.407 5282 LOG S-0x1eb8280:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:5432 new connection to server
2010-07-23 16:33:46.411 5282 LOG C-0x1e9ad80:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:33306 closing because: client close request
(age=0)
2010-07-23 16:33:46.411 5282 LOG S-0x1eb8280:
test/postgres-savSHZN5Fh8qMp+***@public.gmane.org:5432 closing because: unclean server (age=0)
This kills PgBouncer's server backend which effectively kills
connection pooling. I've reproduced this behavior with both 2.2.1 and
2.2.2, but I've verified that 2.0.14 does not have this issue. I'm
running a clean build of PgBouncer 1.3.3 with the default
configuration on Ubuntu 9.04 64-bit with the following PostgreSQL
packages:
ii postgresql 8.3.11-0ubuntu9.04
object-relational SQL database
(supported ve
ii postgresql-8.3 8.3.11-0ubuntu9.04
object-relational SQL database, version
8.3
ii postgresql-client-8.3 8.3.11-0ubuntu9.04
front-end programs for PostgreSQL 8.3
ii postgresql-client-common 97
manager for multiple PostgreSQL client
versi
ii postgresql-common 97
PostgreSQL database-cluster manager
ii postgresql-contrib-8.3 8.3.11-0ubuntu9.04
additional facilities for PostgreSQL
And the small test script that I'm reproducing the issue with:
import psycopg2
connection = psycopg2.connect("dbname=test user=postgres
host=localhost port=6432")
cursor = connection.cursor()
cursor.execute("SELECT 1")
connection.close()
Thanks,
Jason