2dd3ffa271
In "DbQuotaNoLockDriver", when a new reservation is being made, first the expired reservations are removed. That guarantees the freshness of the existing reservations. In systems with high concurrency of operations, the "DbQuotaNoLockDriver.make_reservation" method will be called in parallel. The expired reservations removal implies a deletion on the "reservation" table that could be executed by several workers at the same time (in the same controller or not). That could lead to a "DBDeadlock" exception if multiple workers want to delete the same registers. In case an API worker receives this exception, it should continue as the expired reservations have been deleted by other worker. It should not retry this operation. If the reservations are not deleted, the quota engine will filter out those expired reservations when counting the current number of reservations [1][2][3]. That means even if in a particular request the expired reservations are not deleted, these won't count in the resource quota calculation. The default reservation expiration timeout is set to 120 seconds (as it should have been initially set) that is the default expiration delta for a reservation since 2015. [1] |
||
---|---|---|
.. | ||
__init__.py | ||
api.py | ||
driver.py | ||
driver_nolock.py | ||
models.py |