Opened 11 years ago

Closed 10 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, 11 years ago

Type: UncategorizedBug

comment:2 by Aymeric Augustin, 11 years ago

Triage Stage: UnreviewedAccepted

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

comment:3 by tuxcanfly, 11 years ago

Cc: tuxcanfly added
Has patch: set
Owner: changed from nobody to tuxcanfly
Status: newassigned

comment:4 by Tim Graham, 11 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, 10 years ago

Owner: tuxcanfly removed
Patch needs improvement: unset
Status: assignednew

comment:6 by Tim Graham, 10 years ago

Triage Stage: AcceptedReady for checkin

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

Owner: set to Claude Paroz <claude@…>
Resolution: fixed
Status: newclosed

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