Ah, okay, I think it's this: If db deadlock happens after at least one trip through the loop at https://github.com/openstack/nova/blob/609ddc2244bf9ba84d66cced52e7d4e2987ec669/nova/objects/resource_provider.py#L2061 then a member of the allocs list will have a .id attribute the next time the method is tried.
So we either need to dup the incoming list, or not assign alloc.id like we do. I'll look into it.
Ah, okay, I think it's this: If db deadlock happens after at least one trip through the loop at https:/ /github. com/openstack/ nova/blob/ 609ddc2244bf9ba 84d66cced52e7d4 e2987ec669/ nova/objects/ resource_ provider. py#L2061 then a member of the allocs list will have a .id attribute the next time the method is tried.
So we either need to dup the incoming list, or not assign alloc.id like we do. I'll look into it.