No such file or directory: 'nova.compute.manager'

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

Bug Description

Since bug #1035426 was fixed, the CacheConcurrencyTestCase unit tests can fail with an exception like this:

Traceback (most recent call last):
  File "/home/johannes/virtualenvs/nova/lib/python2.6/site-packages/eventlet/hubs/hub.py", line 336, in fire_timers
    timer()
  File "/home/johannes/virtualenvs/nova/lib/python2.6/site-packages/eventlet/hubs/timer.py", line 56, in __call__
    cb(*args, **kw)
  File "/home/johannes/virtualenvs/nova/lib/python2.6/site-packages/eventlet/greenthread.py", line 192, in main
    result = function(*args, **kwargs)
  File "/home/johannes/openstack/nova/trunk/nova/virt/libvirt/imagebackend.py", line 126, in cache
    *args, **kwargs)
  File "/home/johannes/openstack/nova/trunk/nova/virt/libvirt/imagebackend.py", line 146, in create_image
    prepare_template(target=self.path, *args, **kwargs)
  File "/home/johannes/openstack/nova/trunk/nova/utils.py", line 732, in inner
    ensure_tree(local_lock_path)
  File "/home/johannes/openstack/nova/trunk/nova/utils.py", line 1305, in ensure_tree
    os.makedirs(path)
  File "/home/johannes/virtualenvs/nova/lib/python2.6/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/johannes/virtualenvs/nova/lib/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 2] No such file or directory: 'nova.compute.manager'

It can also fail with similar exceptions in shutil.rmtree().

This is caused by a race condition in the unit test. Two greenthreads are spawned, and the changes to fix bug #1035426 will cause a race between the two threads either creating or deleting the tree.

An unrelated bug will cause the unit test to pass even if the above race condition and exception occur. This is because the greenthreads being tested are never waited on, causing the exceptions to be ignored.

description: updated
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/13226

Changed in nova:
assignee: nobody → Johannes Erdfelt (johannes.erdfelt)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/13226
Committed: http://github.com/openstack/nova/commit/6f2010ca086a1c770017643f631322d4734facd8
Submitter: Jenkins
Branch: master

commit 6f2010ca086a1c770017643f631322d4734facd8
Author: Johannes Erdfelt <email address hidden>
Date: Tue Sep 18 20:03:53 2012 +0000

    Fix race condition in CacheConcurrencyTestCase

    Fixes bug 1052641

    Recent changes made to fix bug 1035426 ended up creating a race
    condition in the tests for CacheConcurrencyTestCase. Since two
    greenthreads are used, the changes to utils.synchronized() can
    cause a race where one thread is deleting the lock directory out
    from under the other thread.

    An unrelated bug caused this race condition to be ignored since
    the greenthreads were never waited on and as a result, the exceptions
    never had a chance to be raised in the test case.

    Change-Id: I86b45414bbacd12bd3f5af323d26e0861c354ba8

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