v1 list operation causes sockets to leak

Bug #1423939 reported by Louis Taylor
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Medium
Louis Taylor

Bug Description

Ever since the move to the requests library, services which use glanceclient are leaking sockets each time a list operation is performed.

To reproduce, on a devstack machine run:

    $ nova image-list

Each time a list operation is done, the list of open connections between nova and glance will increase:

    $ lsof -i | grep 9292

Revision history for this message
Louis Taylor (kragniz) wrote :
Changed in python-glanceclient:
status: New → In Progress
assignee: nobody → Louis Taylor (kragniz)
Louis Taylor (kragniz)
Changed in python-glanceclient:
milestone: none → v0.16.1
Louis Taylor (kragniz)
Changed in python-glanceclient:
milestone: v0.16.1 → v0.17.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/157516
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=f98ab688eff8fff4bdb5f650da3516715d62f232
Submitter: Jenkins
Branch: master

commit f98ab688eff8fff4bdb5f650da3516715d62f232
Author: Louis Taylor <email address hidden>
Date: Thu Feb 19 18:39:20 2015 +0000

    Fix leaking sockets after v1 list operation

    Since the move to using the requests library, v1 list operations keep
    the connection open to the glance server. This is normally closed by the
    garbage collector if it is not explicitly closed, however the paginate
    function used by the list method had a circular reference preventing it
    from ever being collected during the lifecycle of a service consuming
    glanceclient.

    This is problematic, since it causes long running nova processes to run
    out of file descriptors for new connections.

    This patch makes paginate() non-recursive, which allows the connection
    to be freed.

    Change-Id: I16a7b02f2b10e506e91719712cf34ef0aea1afc0
    Closes-Bug: 1423939

Changed in python-glanceclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
importance: Undecided → Medium
status: Fix Committed → Fix Released
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.