You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent 500 on parallel service instance creation (#3899)
We observed 500 responses on POST /v3/service_instances when requests
run in parallel and the db is small.
This occurs if the one POST bypasses the other one and inserts the
record into the db after the first POST has passed the validate function
but before the actual insert. This leads to a PG::UniqueViolation: ERROR:
duplicate key value violates unique constraint which is not catched and
thus results in a 500 response. To prevent this, we add a
Sequel::UniqueConstraintViolation rescue to catch the PG::UniqueViolation error and to return an adequate 422 error "The service instance name is taken.."
0 commit comments