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
self._notifier.info(request.context,
self._resource + '.create.start',
body)
- body = Controller.prepare_request_body(request.context, body, True,
+ body = Controller.prepare_request_body(request.context,
+ copy.deepcopy(body), True,
self._resource, self._attr_info,
allow_bulk=self._allow_bulk)
action = self._plugin_handlers[self.CREATE]