a bug in quota check

Bug #1363324 reported by HenryShen
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Sean Dague

Bug Description

\nova\db\sqlalchemy\api.py quota_reserve()

when decided whether to refresh the user_usages[resource], one rule is that if the last refresh was too long time ago, we need refresh user_usages[resource].

 elif max_age and (user_usages[resource].updated_at -
                              timeutils.utcnow()).seconds >= max_age:

using last update time minus current time result in a overflow ,so that the refresh action always be executed,in consideration of the max_age won't be a max number.

Tags: api db
HenryShen (shenhui2)
Changed in nova:
assignee: nobody → HenryShen (shenhui2)
Tracy Jones (tjones-i)
tags: added: api
Changed in nova:
status: New → Confirmed
Sean Dague (sdague)
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/121259

Changed in nova:
assignee: HenryShen (shenhui2) → Sean Dague (sdague)
status: Confirmed → In Progress
Matt Riedemann (mriedem)
tags: added: db
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/121259
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f6d6c632f620411816979f04b7b3dda28681db18
Submitter: Jenkins
Branch: master

commit f6d6c632f620411816979f04b7b3dda28681db18
Author: Sean Dague <email address hidden>
Date: Fri Sep 12 18:51:29 2014 -0400

    correct inverted subtraction in quota check

    From a user reported bug: we were doing the subtraction backwards
    here, causing int overflow, causing all kinds of invalid. Instead
    actually subtract the smaller number from the bigger number.

    Change-Id: I7c099df5e31aa25b8be65c570e2e0b8a3e93c277
    Closes-Bug: #1363324

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.