Andy Dyer
01/04/2024, 7:56 PMCrash detected! Execution was cancelled by the runtime environment.
with no context no logging nothing. Ill reply with the function in question its pretty benign, anyone have any tips on how to diagnoseAndy Dyer
01/04/2024, 7:59 PMasync def async_get_with_retry(url: str, auth: Optional[aiohttp.BasicAuth] = None) -> Optional[Dict[str, Any]]:
max_client_error_attempts = 10
attempt = 0
while attempt < max_client_error_attempts:
try:
retries = ExponentialRetry(attempts=10, max_timeout=180, statuses={429, 500, 503})
async with RetryClient(retry_options=retries) as client:
async with client.get(url, auth=auth) as response:
# Log the API response
log_api_response(response.status, text=await response.text())
if response.status < 400:
return await response.json()
# If no exception and successful response, break out of the loop
break
except aiohttp.ClientError as e:
# Log the exception here
log_error(f"""Error in async_get_with_retry function in api_utils.py
{attempt} out of {max_client_error_attempts} {url}
{e}""")
attempt += 1
if attempt >= max_client_error_attempts:
break
await asyncio.sleep(1) # Add delay before retrying
return None
Andy Dyer
01/04/2024, 10:04 PMAndy Dyer
01/04/2024, 10:19 PMtasks = [
asyncio.ensure_future(async_get_with_retry(url=url, auth=auth))
for url in batch
]
Kevin Grismore
01/04/2024, 10:22 PMAndy Dyer
01/04/2024, 10:23 PMAndy Dyer
01/04/2024, 10:23 PMKevin Grismore
01/04/2024, 10:23 PMAndy Dyer
01/04/2024, 10:24 PMAndy Dyer
01/04/2024, 10:24 PMAndy Dyer
01/04/2024, 10:25 PMKevin Grismore
01/04/2024, 10:26 PMAndy Dyer
01/04/2024, 10:27 PMAndy Dyer
01/04/2024, 10:27 PMAndy Dyer
01/04/2024, 10:29 PMKevin Grismore
01/04/2024, 10:29 PMAndy Dyer
01/04/2024, 10:31 PMAndy Dyer
01/04/2024, 10:31 PMKevin Grismore
01/04/2024, 10:33 PMKevin Grismore
01/04/2024, 10:34 PMAndy Dyer
01/04/2024, 10:35 PMKevin Grismore
01/04/2024, 10:36 PMexcept
blockAndy Dyer
01/04/2024, 10:40 PMKevin Grismore
01/04/2024, 10:41 PMexcept
as is may be eating the error with some useful info in it