]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Quota enforcement: remove locks on _dirty_tenants
authorsalvatore <salv.orlando@gmail.com>
Fri, 21 Aug 2015 08:10:56 +0000 (10:10 +0200)
committerSalvatore Orlando <salv.orlando@gmail.com>
Tue, 25 Aug 2015 08:30:21 +0000 (01:30 -0700)
commit91852a7f529d276052e898480307c727be20fab3
tree4777ac134f5acc3c0f569f19dc9098b2331baec1
parent1c19e898c0199c33a0273eb906cf63075269234c
Quota enforcement: remove locks on _dirty_tenants

This lock was used to avoid errors due to list contents changing
during iteration, but is causing issues with pymysql. This patch
proposes an alternative approach which makes the use of a lock
unnecessary.

With this change a copy of the dirty_tenants set is made before
setting the dirty bit on resources, and then the mark_dirty routine
operates on this copy. This still guaranteses operations
correctness, as all the tenants that should be marked dirty are
marked dirty before the completion of the relevant API request.

Related-Blueprint: better-quotas

Change-Id: Ib39e7089889d3f906bdc025c843128a1fa3e8797
neutron/quota/resource.py