floating IPs extension should not catch NoMoreFloatingIps and re-raise as EntityTooLarge

Bug #1026167 reported by Mark McLoughlin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Eoghan Glynn

Bug Description

See bug #1021721 and #1021373

The floating IPs extension is doing this:

        try:
            address = self.network_api.allocate_floating_ip(...)
            ...
        except exception.NoMoreFloatingIps:
            ..
            raise webob.exc.HTTPRequestEntityTooLarge(explanation=msg)

however, there's no need for this now becausethe faultwrap Middleware will now catch QuotaError based exceptions and re-raise them as a 413 error

Mark McLoughlin (markmc)
Changed in nova:
assignee: nobody → Eoghan Glynn (eglynn)
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Interestingly, https://review.openstack.org/9738 was actually addressing the wrong exception.

NoMoreFloatingIps is raised when the floating IP range is exhausted, whereas the case referred to in bug #1021721 is floating IP quota over-run, which is indicated by a FloatingIpLimitExceeded.

Now the FloatingIpLimitExceeded case is already reported as a 413, since the fix for bug #1021373 landed.

Whereas the initial patch for bug #1021721 is problematic, as it leads to a 500 Server Error due to the retry-after header being left unset.

So I would propose allowing the exception.NoMoreFloatingIps to bubble up to the FaultWrapper middleware, and then treating this as a 404 as opposed to a 413.

The reasoning here is that NoMoreFloatingIps extends NotFound, which is in turn associated with the 404 status, so the intent appears to be that floating IP range exhaustion is treated as a free floating IP resource not being found.

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/10019

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/10019
Committed: http://github.com/openstack/nova/commit/ebc05b803615b78a14008136bb549a41013e6cd1
Submitter: Jenkins
Branch: master

commit ebc05b803615b78a14008136bb549a41013e6cd1
Author: Eoghan Glynn <email address hidden>
Date: Thu Jul 19 16:19:49 2012 +0100

    Allow NoMoreFloatingIps to bubble up to FaultWrapper

    Fixes LP 1026167.

    The fix for LP 1021721 caught the wrong exception in order to
    address floating IP quota over-run. NoMoreFloatingIps is raised
    when the floating range is exhausted, whereas FloatingIpLimitExceeded
    is raised on over-quota.

    Also the HTTPRequestEntityTooLarge exception raised is mapped
    to 500 Server Error due to the required retry-after header being
    left unset.

    We now allow the NoMoreFloatingIps to bubble up to the FaultWrapper
    middleware, where its mapped to a 404 status due to it extending
    the NotFound exception.

    Change-Id: Id35c487113059ec3053f2f9e9e7eca24854ac02c

Changed in nova:
status: In Progress → Fix Committed
Eoghan Glynn (eglynn)
Changed in nova:
milestone: none → folsom-3
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.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.