]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix log traces induced by retry decorator
authorarmando-migliaccio <armamig@gmail.com>
Wed, 1 Jul 2015 19:00:14 +0000 (12:00 -0700)
committerarmando-migliaccio <armamig@gmail.com>
Wed, 1 Jul 2015 20:54:50 +0000 (13:54 -0700)
commit49569327c20d8a10ba3d426833ff28d68b1b7a27
tree547302042aef590170f029f4aed5c536fd845135
parent4fa3c0619df7fff5e9abca04d54c6413db74bfa9
Fix log traces induced by retry decorator

Patch 4e77442d5 added a retry decorator to the API layer
to catch DB deadlock errors. However, when they occur, the
retried operation ends up being ineffective because the original
body has been altered, which leads the notification and validation
layers to barf exceptions due to unrecognized/unserializable elements.

This ultimately results to an error reported to the user.

To address this, let's make a deep copy of the request body, before
we pass it down to the lower layers. This allows the decorator to
work on a pristine copy of the body on every attempt. The performance
impact for this should be negligible.

Closes-bug: #1470615

Change-Id: I82a2a002612d28fa8f97b0afbd4f7ba1e8830377
neutron/api/v2/base.py