hil
hil copied to clipboard
Handle DB transaction failure
Currently, we have a bunch of code that assumes that DB commits through SQLAlchemy succeed. They could fail due to concurrent requests that modify any shared objects.
We should catch the failures and do something sensible. One way to do this is to catch the exception before dispatching to the API call and retry the operation some number of times. If the retry count were exceeded, we could return a 503 status to the user.
Discussed with @gsilvis and @zenhack