use of sleep in nova_rootwrap test is a race condition

Bug #1071443 reported by Monty Taylor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Monty Taylor

Bug Description

In nova/tests/test_nova_rootwrap.py, test_KillFilter spawns a sleep and then attempts to kill it. The problem is, a latency spike could cause the subsequent kill to wait long enough for the sleep to go away, and then boom, test suck.

Instead of sleep, perhaps cat with stdin=PIPE stdout=PIPE stderr=STDIN would sit there doing nothing indefinitely.

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

Changed in nova:
assignee: nobody → Monty Taylor (mordred)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit b0529de679056935a48b6a1e9879765ffdc1799b
Author: Monty Taylor <email address hidden>
Date: Thu Oct 25 11:39:31 2012 -0700

    Use cat instead of sleep for rootwrap test.

    Sleep is a race condition. cat will block indefinitely.

    Fixes bug 1071443

    Change-Id: Ia731580ed335e53646aa67b2e7b9424118f0c9d5

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote :

Hrm. The idea behind using sleep was that the created process would always die after 5 seconds (the test does not kill the process at all). Here your "cat" will survive a lot longer (until all tests complete and parent process dies ?) which might or might not be an issue ?

Maybe consider terminating that subprocess at the end of test_KillFilter ?

Revision history for this message
Monty Taylor (mordred) wrote :

Yeah, ok. Fair enough.

Revision history for this message
Thierry Carrez (ttx) wrote :

Filed that as separate bug, see bug 1079629

Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-1 → 2013.1
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.