Add async wait to the payload body checker. (#362)

Today, when valid payloads are sent, async polling is not done and the objects
are leaked.
This fix makes the checker behave the same way as everywhere else - async wait
until the dynamic objects can be parsed out of the response
and garbage collected to avoid quota issues.

Note: this is a quick fix to attempt to resolve the observed quota issues.
It may be desirable to improve this in the future, for example, to avoid
waiting for async polling if all the dynamic objects are available from
names in the request (to avoid waiting to parse the response before deleting it).

The above may not be useful in all cases, since some resources may need to be
fully created before they can be referenced in order to be deleted.
This commit is contained in:
marina-p 2021-10-06 11:07:40 -07:00 коммит произвёл GitHub
Родитель b8c1fd85a1
Коммит a5b760e25e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -1163,9 +1163,13 @@ class PayloadBodyChecker(CheckerBase):
except Exception:
rendered_data = original_rendered_data
# send out the request
# send out the request and parse the response
response = self._send_request(parser, rendered_data)
request_utilities.call_response_parser(parser, response)
async_wait = Settings().get_max_async_resource_creation_time(request.request_id)
response_to_parse, _, _ = async_request_utilities.try_async_poll(
rendered_data, response, async_wait)
request_utilities.call_response_parser(parser, response_to_parse)
self._set_refresh_req(request, response)
if not response or not response.status_code: