uninitialized local variable ‘sibling_set’ referenced before assignment.

Bug #1685226 reported by Sahid Orentino
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Undecided
Unassigned

Bug Description

The code is using a variable which can be not defined if sibling_sets (plural) is empty.

        # NOTE(sfinucan): If siblings weren't available and we're using PREFER
        # (implicitly or explicitly), fall back to linear assignment across
        # cores
        if (instance_cell.cpu_thread_policy !=
                fields.CPUThreadAllocationPolicy.REQUIRE and
                not pinning):
            pinning = list(zip(sorted(instance_cell.cpuset),
                                 itertools.chain(*sibling_set))) <-----not defined if sibling_sets is empty

So far the only path I could see to be in a situation where sibling_sets is empty at this step would be if two instances get scheduled "in same time" in the same host where we could consider that all the checks to ensure that the host cell provides enough cpus to handle the request have been accepted.

Even if that could happen only in such circumstance which should fix the issue.

[0] https://github.com/openstack/nova/blob/master/nova/virt/hardware.py#L882

Tags: numa
Changed in nova:
assignee: nobody → sahid (sahid-ferdjaoui)
Changed in nova:
status: New → In Progress
Revision history for this message
Thomas Herve (therve) wrote :

Seeing this repeatedly in logs:

Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1783, in _do_build_and_run_instance\n filter_properties)\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1981, in _build_and_run_instance\n instance_uuid=instance.uuid, reason=six.text_type(e))\n', u"RescheduledException: Build of instance a0f8fa09-d0dc-4652-883c-f8b533fc3aec was re-scheduled: local variable 'sibling_set' referenced before assignment\n

Revision history for this message
Sahid Orentino (sahid-ferdjaoui) wrote :

Interesting thanks for that - Can you share a bit more of information about the host CPU topology and configuration for Nova, example are you using the option CONF.vcpu_pin_set? is the host configured to use hyperthreading, what is the host NUMA topology and guest requested?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.openstack.org/458848

Revision history for this message
Matt Riedemann (mriedem) wrote :

Looks like the patch from Sahid was abandoned because a unit test wasn't provided.

Changed in nova:
assignee: Sahid Orentino (sahid-ferdjaoui) → nobody
status: In Progress → Confirmed
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.