Infinite recursion in StackManager.list's paginate sub-function

Bug #1207839 reported by Jason Dunsmore
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-heatclient
Fix Released
High
Steve Baker

Bug Description

If you start 20 "stack-create"s (single- or multi-engine), heatclient hangs due to a recursive call to paginate() inside of StackManager.list. Here's the output:
http://dunsmor.com/heat/multi-engine.html#sec-1-4-1

Here's the command to reproduce:

for i in {1..20}; do heat_client stack-create wp$i -u http://dunsmor.com/heat/heat-templates/rackspace/Wordpress_Single_Instance.yaml -P "DBUsername=wp;DBPassword=verybadpassword" & done

...where heat_client is:

heat_client() {
    heat --heat-url http://1.2.3.4:8004/v1/12345 --os-username myuser --os-password mypass --os-tenant-name 12345 --os-auth-url https://identity.api.rackspacecloud.com/v2.0/ $@
}

At that point, several of the "stack-create" calls will be stuck. A "stack-list" will also get stuck.

description: updated
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Seems we've had at least two sightings. Marking as Confirmed.

Changed in python-heatclient:
status: New → Confirmed
importance: Undecided → High
Changed in python-heatclient:
assignee: nobody → Steve Baker (steve-stevebaker)
milestone: none → v0.2.4
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

I have a test which replicates this.

The problem is that the client assumes that the server supports pagination, which currently it does not. Even if we implemented pagination on the server now, this issue would still occur on older server versions.

The fix for the the client will be: if no page size is explicitly specified, perform no pagination.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-heatclient (master)

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

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

Reviewed: https://review.openstack.org/40152
Committed: http://github.com/openstack/python-heatclient/commit/79dea076dbd5f35c0572b51dfcceeb5112772091
Submitter: Jenkins
Branch: master

commit 79dea076dbd5f35c0572b51dfcceeb5112772091
Author: Steve Baker <email address hidden>
Date: Mon Aug 5 15:29:16 2013 +1200

    Do not paginate stack list unless page_size is set

    Pagination on the server has not yet been implemented, however
    the client assumes it is, causing infinite recursion when paginate
    is called.

    With this change, no pagination is attempted unless page_size is
    specified. However the 'limit' parameter is still honored, so it
    is still possible to cap the total number of results returned.

    heatclient users should not set page_size until pagination has been
    implemented on the server. The stack list in Horizon currently
    does not attempt to paginate, so is not affected.

    Fixes: bug #1207839
    Change-Id: I4087d3a8af48206d6ebe3edc441469464e4a401a

Changed in python-heatclient:
status: In Progress → Fix Committed
Changed in python-heatclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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