Comment 20 for bug 1202896

Revision history for this message
Duncan Thomas (duncan-thomas) wrote :

> I propose to implement quota reservation as a context manager:
>
> with quotas.reserve(...) as reservation:
> ...
>
> This will allow us to make sure that quotas always stay consitent and
> will remove the need to expire quotas. I can prepare a POC patch if
> you are interested. What do you think?

I don't think we can do this in cinder, the fact that we reserve in the API and commit in the manager appears to be entirely necessary - we reserve in the API so that we can give sensible warnings about being out of quota back to the caller, but we can't commit until the manager since we don't know whether the resource is actually consumed or not until then.

It might be useful to add more information to the reservation record - the request id that caused the reservation for example, then we have some ability to match troublesome reservations to the rest of the logs.