According to bug [1], there are some possibilities that concurrent
operations on keypair/security rules can exceed quota
Found that we have 3 kinds of resources in quotas.py:
ReservableResource/AbsoluteResource/CountableResource

curious about CountableResource because it's can't be thread safe due to
its logic:

count = QUOTAS.count(context, 'security_group_rules', id)
try:
            projected = count + len(vals)
            QUOTAS.limit_check(context, security_group_rules=projected)

was it designed by purpose to be different to ReservableResource? If set it
to ReservableResource just like RAM/CPU, what kind of side effect it might
lead to ?

Also, is it possible to consider a solution like 'hold a write lock in db
layer, check the count of resource and raise exception if it exceed quota'?

Thanks


[1] https://bugs.launchpad.net/nova/+bug/1301532

Best Regards!

Kevin (Chen) Ji 纪 晨

Engineer, zVM Development, CSTL
Notes: Chen CH Ji/China/IBM@IBMCN   Internet: jiche...@cn.ibm.com
Phone: +86-10-82454158
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District,
Beijing 100193, PRC
_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to