333f035ed2
There's a potential deadlock when creating the first LB in a new project. The query that creates an empty quota object for the project may have triggered a deadlock in the DB, this deadlock should have been handlded by an oslo_db.api.wrab_db_retry decorator but the decorated function was incorrect called: the DB session must begin in the decorated function and not in the caller. If begin is called by the caller, in case of retry sqlalchemy will complain that the session was not correctly restarted after a rollback. Closes-Bug: #2038798 Change-Id: Iec1f8f8f61d77640d4a33d7ffb62925f7e860286