test_interrupt_avoids_respawn_storm leaves behind glance-api processes

Bug #1000931 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Dan Prince

Bug Description

When running the Glance tests repeatedly it looks like glance-api processes are leaking. After a bit of debugging it looks like test_multiprocessing:TestMultiprocessing.test_interrupt_avoids_respawn_storm might be the culprit:

# killall python
python: no process found
# ./run_tests.sh glance.tests.functional.v1.test_multiprocessing:TestMultiprocessing.test_interrupt_avoids_respawn_storm
TestMultiprocessing
    test_interrupt_avoids_respawn_storm OK

----------------------------------------------------------------------
Ran 1 test in 4.151s

OK
# ps auwx | grep python
root 7548 0.1 1.2 247788 26480 ? S 18:49 0:00 python /root/glance/bin/glance-api --config-file /tmp/test.9014/etc/api.conf
root 7551 0.0 1.2 247788 26340 ? S 18:49 0:00 python /root/glance/bin/glance-api --config-file /tmp/test.9014/etc/api.conf
root 7694 0.0 0.0 109244 856 pts/0 S+ 18:49 0:00 grep --color=auto python

----

Dan Prince (dan-prince)
Changed in glance:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Dan Prince (dan-prince) wrote :

Okay. This is tricky. It looks like the process tree has the following in it when the test executes:

root 9291 1 72 19:03 ? 00:00:00 python /root/glance/bin/glance-api --config-file /tmp/test.58526/etc/api.conf
root 9292 9291 0 19:03 ? 00:00:00 logger -t glance-api[9291]
root 9307 9291 0 19:03 ? 00:00:00 python /root/glance/bin/glance-api --config-file /tmp/test.58526/etc/api.conf
root 9309 9291 0 19:03 ? 00:00:00 python /root/glance/bin/glance-api --config-file /tmp/test.58526/etc/api.conf
root 9316 9281 0 19:03 pts/0 00:00:00 /bin/sh -c ps -fu $USER | grep glance-api
root 9318 9316 0 19:03 pts/0 00:00:00 grep glance-api

The test code creates an array of pids sorted numerically sorted in reverse (largest to smallest) meaning the child pids should be at the top of the list.

The old code stripped off the last two processes leaving us with this: --> ['9309', '9307', '9292']

It should be this (just the child pids): -->['9309', '9307']

The *fix* should be to just take the first two pids in the array. Given the test has 2 workers we should be able to rely on this not changing.

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/7555
Committed: http://github.com/openstack/glance/commit/dd81f120fd68e136d21fe8f17eae0b3e4fba370d
Submitter: Jenkins
Branch: master

commit dd81f120fd68e136d21fe8f17eae0b3e4fba370d
Author: Dan Prince <email address hidden>
Date: Thu May 17 15:14:38 2012 -0400

    Fix glance-api process leak in respawn storm test.

    Fixes a glance-api process leak that occurs when running
    TestMultiprocessing.test_interrupt_avoids_respawn_storm.

    The test code creates an array of pids sorted numerically sorted in
    reverse (largest to smallest) meaning the child pids should be at the
    top of the list. This patch simply grabs the child pids from the top of
    the list instead of relying on the length of the list.

    Fixes LP Bug #1000931.

    Change-Id: I91d538e686a770778d9855a1bd5a1767cc83842e

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → folsom-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: folsom-1 → 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.