Opened 13 years ago

Closed 12 years ago

#21255 closed Bug (fixed)

Django doesn't closes connection when running from management command

Reported by: kabakov.as@… Owned by: Claude Paroz <claude@…>
Component: Database layer (models, ORM) Version: 1.5
Severity: Normal Keywords: connection postgres management
Cc: tuxcanfly Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When runing django from mangemnt command
Django doesn't closes database connection

Walkaround to problem may be found here: ​http://stackoverflow.com/questions/16841505/django-resetting-postgres-connection

I think this is a django bug, and django should close connection by it self

When runned as ./manage.py shell
Connection should be automatically closed as well

Change History (7)

comment:1 by anonymous, 13 years ago

Type: Uncategorized → Bug

comment:2 by Aymeric Augustin, 13 years ago

Triage Stage: Unreviewed → Accepted

Yes, the base class for management commands should call django.db.close_connection before exiting.

comment:3 by tuxcanfly, 13 years ago

Cc: tuxcanfly added
Has patch: set
Owner: changed from nobody to tuxcanfly
Status: new → assigned

comment:4 by Tim Graham, 12 years ago

Patch needs improvement: set

Current PR has comments for improvement. Please uncheck "Patch needs improvement" when you update it, thanks.

comment:5 by Claude Paroz, 12 years ago

Owner: tuxcanfly removed
Patch needs improvement: unset
Status: assigned → new

comment:6 by Tim Graham, 12 years ago

Triage Stage: Accepted → Ready for checkin

comment:7 by Claude Paroz <claude@…>, 12 years ago

Owner: set to Claude Paroz <claude@…>
Resolution: → fixed
Status: new → closed

In 1d24f073e65113c8c6d974db0504ef7d083809f7:

Fixed #21255 -- Closed connections after management command ran

Thanks kabakov.as@… for the report, and Aymeric Augustin,
Simon Charette for the reviews.

Note: See TracTickets for help on using tickets.
Back to Top