account and container database module common.db should use documented sqlite3 error codes instead of strings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
We currently classify errors from the sqlite3 module talking to account and container databases by the error message string [1].
This is a terrible/brittle taxonomy and leads to mistakes/gaps [2].
According to the sqlite3 documentation there are broad catagories of error codes that would be wonderfully suited for the possibly_quarantine method [3], but they're apparently not availabe from CPython [4, 5, 6].
1. https:/
2. e.g. lp bug #1646247
3. https:/
4. https:/
5. http://
6. https:/
Changed in swift: | |
status: | New → Won't Fix |
So what's the scope involved here? Patch Python to do something better with error codes, then move Swift to only support py36+? Roll our own (C-based?) SQLite lib?
I agree that the current situation isn't great, but I'm not really seeing a better way forward. *Maybe* we could look for some particular instances (IntegrityError, maybe? Given that DatabaseError is the default, that seems too broad... we *have* to go digging through strings)
Meanwhile, by falling back to reraising, we get noisy logs that prompt us to shore up the gaps pretty quickly when they come up. Three days from bug report to fix merged seems not bad... I kinda wanna just close as Won't Fix.