Friday, August 1, 2014

Re: hanging django/postgres idle connections

Haven't tried (yet), I'm new to Python & Django & Postgres, got on board with Python 3.4.1 and Django 1.7c1. I'm starting to suspect this isn't really Django related directly, since I can consistently reproduce the problem following way: 1) Run e.g. test case, break it in debugger 2) Stop debug session. Django cannot really do anything about me interrupting the debugging session, but it should not block access to DB indefinitely. However, it does. I tried also to install pgbouncer, but it made interestingly situation worse, now even a single connection can block access to DB even if I have pgbouncer max_connections set to 100. So maybe this is something Windows/VirtualBox networking related.

On Thursday, July 31, 2014 10:58:41 PM UTC+7, Collin Anderson wrote:
Does it work fine on django 1.6? It could be a regression.

On Wednesday, July 30, 2014 10:41:58 AM UTC-4, Jani Kajala wrote:
Hi,

I have a problem with leaking Postgres DB connections even if I have CONN_MAX_AGE=0. Every time I start the server and stop it by Ctrl+Break a DB connection is leaked.

When I check from Postgres there is bunch of "idle" connections with following content:
SELECT "django_migrations"."app", "django_migrations"."name" FROM "django_migrations"

I'm running Python on Windows 8 + virtualenv with following installs:
Django==1.7c1
future==0.12.4
psycopg2==2.5.3
python3-memcached==1.51
pytz==2014.4
six==1.7.3
sqlparse==0.1.11
virtualenv==1.11.6
xlwt-future==0.8.0

Postgres is running in Ubuntu 14.04 in latest Oracle VirtualBox on same Windows machine.

Any ideas?


Thanks,
Jani

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/56d78f9a-cd64-4353-ba34-12b4528fb2a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment