#29257: If creation of a db cursor fails, the resulting traceback is misleading
-------------------------------------+-------------------------------------
Reporter: Jerome Leclanche | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michal Mládek):
* owner: Michal Mládek => (none)
* status: assigned => new
Comment:
I don't think this is a bug. It seems more like a code style consideration
— specifically, how to handle exceptions when `cursor.close()` itself
raises an error.
In practice, cursor closure can fail for many reasons, and seeing the
original exception with full traceback is often more helpful than hiding
it behind secondary issues.
Some possible reasons why closing the cursor might fail:
1. Lost connection to the database
2. Exceeding the connection limit
3. Transaction-related inconsistencies
4. Bugs in the DB driver
5. Insufficient DB permissions
6. System resource exhaustion
7. Misconfiguration on the Django or DB side
Given that, I believe the current behavior is appropriate, and this ticket
could be closed as “not a bug” or “works as intended.”
Happy to hear if others see a concrete problem that this change would
solve.
--
Ticket URL: <https://code.djangoproject.com/ticket/29257#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070196d2fdd309-f0e8f1ac-8906-4b6a-8ee4-49654f6ed0f0-000000%40eu-central-1.amazonses.com.