You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When HTTP POST request causes errors other than aiohttp.ClientResponseError, such as aiohttp.TimeOutError, the function doesn't retry and outputs the following error trace and Log entry sent message.
[ERROR] TimeoutError
Traceback (most recent call last):
File "/var/task/function.py", line 510, in lambda_handler
asyncio.run(_send_log_entry(log_entry, context))
File "/var/lang/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/var/lang/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/var/task/function.py", line 222, in _send_log_entry
return await asyncio.gather(*requests)
File "/var/task/function.py", line 228, in _send_payload
status, url = await http_post(
File "/var/task/function.py", line 135, in http_post
resp = await session.post(url, data=data, headers=headers)
File "/var/task/aiohttp/client.py", line 466, in _request
await resp.start(conn)
File "/var/task/aiohttp/client_reqrep.py", line 803, in start
self._continue = None
File "/var/task/aiohttp/helpers.py", line 603, in __exit__
raise asyncio.TimeoutError from None
Here is the whole log for this invocation. It looks the request succeeded for the log endpoint but failed for the infra endpoint.
START RequestId: ***(masked)*** Version: $LATEST
Log entry sent. Response code: 202. url: https://log-api.newrelic.com/log/v1
[ERROR] TimeoutError
END RequestId: ***(masked)***
REPORT RequestId: ***(masked)*** Duration: 3821.20 ms Billed Duration: 3822 ms Memory Size: 128 MB Max Memory Used: 77 MB
When session.post raises an error such as aiohttp.TimeOutError, except block doesn't handle this error. It means retry logic doesn't work.
The http_post method raises an error and this error isn't handled anywhere and goes to out of the function. It means lambda invocation fails and the function will be retried if the retry is enabled.
Could you add more except blocks for such errors as TimeOutError?
The text was updated successfully, but these errors were encountered:
When HTTP POST request causes errors other than
aiohttp.ClientResponseError
, such asaiohttp.TimeOutError
, the function doesn't retry and outputs the following error trace andLog entry sent
message.Here is the whole log for this invocation. It looks the request succeeded for the log endpoint but failed for the infra endpoint.
When
session.post
raises an error such asaiohttp.TimeOutError
, except block doesn't handle this error. It means retry logic doesn't work.The http_post method raises an error and this error isn't handled anywhere and goes to out of the function. It means lambda invocation fails and the function will be retried if the retry is enabled.
Could you add more except blocks for such errors as TimeOutError?
The text was updated successfully, but these errors were encountered: