commit 419e6198fadf4e91855109b76374d5205164b467
Author: Dan Smith <email address hidden>
Date: Fri May 18 09:28:18 2018 -0700
Make instance.refresh() avoid recursion better
The instance.refresh() method is careful to prevent recursion, to avoid
lazy-loads on the object we just pulled from the database. However, it
was allowing those to raise OrphanedObjectError to the caller to make
them visible. The caller is not really at fault in that case, and can not
avoid it.
The only time this has ever come up is in the context of cellsv1 and the
keypairs field that it doesn't have set on instances in the child cells.
Thus, this changes refresh() to just skip fields that are set on the
current object and unset on the one we pull from the database, as we
would not be able to refresh those anyway. This logs the situation so that
it is visible (at DEBUG) if it becomes relevant.
Closes-Bug: #1772088
Change-Id: Ibfca4ae922766b5b977e217594d12e1169ddeee8
(cherry picked from commit 549e5a2226ccf3920fd49e6726d5cea7fabf2914)
Reviewed: https:/ /review. openstack. org/569576 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=419e6198fad f4e91855109b763 74d5205164b467
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit 419e6198fadf4e9 1855109b76374d5 205164b467
Author: Dan Smith <email address hidden>
Date: Fri May 18 09:28:18 2018 -0700
Make instance.refresh() avoid recursion better
The instance.refresh() method is careful to prevent recursion, to avoid
lazy-loads on the object we just pulled from the database. However, it
was allowing those to raise OrphanedObjectError to the caller to make
them visible. The caller is not really at fault in that case, and can not
avoid it.
The only time this has ever come up is in the context of cellsv1 and the
keypairs field that it doesn't have set on instances in the child cells.
Thus, this changes refresh() to just skip fields that are set on the
current object and unset on the one we pull from the database, as we
would not be able to refresh those anyway. This logs the situation so that
it is visible (at DEBUG) if it becomes relevant.
Closes-Bug: #1772088
Change-Id: Ibfca4ae922766b 5b977e217594d12 e1169ddeee8 20fd49e6726d5ce a7fabf2914)
(cherry picked from commit 549e5a2226ccf39