commit_on_success does not handle SystemExit
|Reported by:||eric@…||Owned by:||fgallina|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I do not know if commit_on_success intentionally only catches Exception instead of BaseException (or just a plain except:). I was writing a command-line script that called sys.exit(1) when it detected a problem, but the transaction manager was raising TransactionManagementError("Transaction managed block ended with pending COMMIT/ROLLBACK") and it took me a long time to figure out what was going on.
If you don't want to change it to catch all exceptions, may I suggest adding a small note to the docs?
Change History (4)
comment:1 Changed 9 years ago by SmileyChris
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Design decision needed
comment:2 Changed 6 years ago by mtredinnick
- Triage Stage changed from Design decision needed to Accepted