﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22556	close_if_unusuable_or_obsolete should handle InterfaceError	Raymond Penners	nobody	"With Django 1.6.2 I ran into the following stack trace:

{{{
...
    close_old_connections()
  File ""/somewhere/virtualenv/local/lib/python2.7/site-packages/django/db/__init__.py"", line 94, in close_old_connections
    conn.close_if_unusable_or_obsolete()
  File ""/somewhere/virtualenv/local/lib/python2.7/site-packages/django/db/backends/__init__.py"", line 462, in close_if_unusable_or_obsolete
    if self.is_usable():
  File ""/somewhere/virtualenv/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py"", line 192, in is_usable
    self.connection.cursor().execute(""SELECT 1"")
InterfaceError: connection already closed
<... at 0xac6ec0c> failed with InterfaceError
}}}

I see that `close_if_unusuable_or_obsolete` gracefully handles `DatabaseError` exceptions. Shouldn't `InterfaceError` be caught as well?

FWIW -- I am invoking `close_old_connections` myself because I am making heavy use of greenlets. I would like to call a Django method to close connections if needed, without having to worry about exceptions like these.

"	Uncategorized	closed	Database layer (models, ORM)	1.6	Normal	fixed			Unreviewed	0	0	0	0	0	0
