Merge lp://staging/~jamesh/storm/bug-854787 into lp://staging/storm
Proposed by
James Henstridge
Status: | Merged |
---|---|
Merged at revision: | 411 |
Proposed branch: | lp://staging/~jamesh/storm/bug-854787 |
Merge into: | lp://staging/storm |
Diff against target: |
277 lines (+116/-22) 6 files modified
storm/database.py (+7/-3) storm/databases/mysql.py (+3/-2) storm/databases/postgres.py (+2/-2) storm/django/backend/base.py (+9/-2) tests/database.py (+34/-4) tests/django/backend.py (+61/-9) |
To merge this branch: | bzr merge lp://staging/~jamesh/storm/bug-854787 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | Approve | ||
Martin Albisetti (community) | Approve | ||
Review via email: mp+76559@code.staging.launchpad.net |
Description of the change
My previous patch to fix the detection of database disconnection errors in the Storm <-> Django bridge did not work correctly.
While it passed the DB access from the cursor through _check_
This branch updates the disconnection checkers to handle the extra exception. It is not quite as neat as I'd like, so if anyone has suggestions that might improve it, I'm open to suggestions.
To post a comment you must log in.
You asked for suggestions too, so...
The disconnection errors don't change. Should the connection object have a method to register extra disconnection errors instead of them being passed in as arguments?
Instead of providing a list of exceptions and relying on the existing behavior of is_disconnectio n_error, should a callable be passed instead? This would provide more control to sniff the database exception when it isn't generic enough. Or is the goal here to insure the current is_disconnectio n_error logic is used because the PG backend already sniffs the errors strings?
How does this code handle and integrity violation (or other DatabaseError) btw? Given these seem to be thunked down from IntegrityError to DatabaseError it would be worth a test even if the test is demonstrating broken behavior and citing a bug in the Django bug tracker.