TypeError in periodic task 'update_available_resource'

Bug #1238374 reported by wangpan
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
Havana
Fix Released
Medium
Chuck Short

Bug Description

this occurs while I creating an instance under my devstack env:

2013-10-11 02:56:29.374 ERROR nova.openstack.common.periodic_task [-] Error during ComputeManager.update_available_resource: 'NoneType' object is not iterable
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task Traceback (most recent call last):
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task File "/opt/stack/nova/nova/openstack/common/periodic_task.py", line 180, in run_periodic_tasks
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task task(self, context)
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task File "/opt/stack/nova/nova/compute/manager.py", line 4859, in update_available_resource
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task rt.update_available_resource(context)
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task File "/opt/stack/nova/nova/openstack/common/lockutils.py", line 246, in inner
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task return f(*args, **kwargs)
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task File "/opt/stack/nova/nova/compute/resource_tracker.py", line 313, in update_available_resource
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task self.pci_tracker.clean_usage(instances, migrations, orphans)
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task File "/opt/stack/nova/nova/pci/pci_manager.py", line 285, in clean_usage
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task for dev in self.claims.pop(uuid):
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task TypeError: 'NoneType' object is not iterable
2013-10-11 02:56:29.374 TRACE nova.openstack.common.periodic_task

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

Confirmed. I can see that the code is careful about checking self.claims and self.allocations in the pci_manager but it's missing the check in this case.

tags: added: compute
Changed in nova:
status: New → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :

I've confirmed that the nova.compute.resource_tracker.update_available_resource method does synchronize on the COMPUTE_RESOURCE_SEMAPHORE global so it's not a locking issue, the claims map just be mapping the uuid to None.

Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
tags: added: havana-backport-potential
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/51483

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit c28c87db4c2b20e0f6c1375d2d4433e06c4e1743
Author: Matt Riedemann <email address hidden>
Date: Sun Oct 13 13:51:37 2013 -0700

    Check for None when cleaning PCI dev usage

    The PCI manager needs to check for instance UUIDs mapped to
    None when cleaning up it's internal claims/allocations maps.

    Also adds a check so the claims dict doesn't map to None in
    the first place. There was already a check like this when
    setting a value in the allocations dict.

    Closes-Bug: #1238374

    Change-Id: I7ac010f7d50ad85c145e536cfd48e07c8f4602d3

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/54558

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/havana)

Reviewed: https://review.openstack.org/54558
Committed: http://github.com/openstack/nova/commit/76a46af214fd14d8e25b015d2834add70a8c9cf1
Submitter: Jenkins
Branch: stable/havana

commit 76a46af214fd14d8e25b015d2834add70a8c9cf1
Author: Matt Riedemann <email address hidden>
Date: Sun Oct 13 13:51:37 2013 -0700

    Check for None when cleaning PCI dev usage

    The PCI manager needs to check for instance UUIDs mapped to
    None when cleaning up it's internal claims/allocations maps.

    Also adds a check so the claims dict doesn't map to None in
    the first place. There was already a check like this when
    setting a value in the allocations dict.

    Closes-Bug: #1238374

    Change-Id: I7ac010f7d50ad85c145e536cfd48e07c8f4602d3
    (cherry picked from commit c28c87db4c2b20e0f6c1375d2d4433e06c4e1743)

Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Alan Pevec (apevec)
tags: removed: havana-backport-potential
Changed in nova:
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.