Persistent connections, take 2
Feb 27, 2013 3:12 PM
Posted in group:
Django developers (Contributions to Django itself)
I've integrated the feedback received on my initial proposal in a new pull request:
and I think it's ready for review.
I'm just wondering if 10 minutes is a good default value for CONN_MAX_AGE.
I chose it randomly. Would "unlimited" be better?
Unfortunately, this code is difficult to test automatically, for two reasons:
- The testing framework needs a permanent database connection; it inhibits
the closing of the connection triggered on request_started / request_finished.
- Database errors cannot be produced at will.
I've done some manual testing with gunicorn. Django recovers as expected
after a database restart, ie. one request fails and the next one succeeds.
Thanks for your feedback,