-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS Lambda stream read timeout #857
Comments
can use the timeouts from botocore: aioboto_session = aiobotocore.session.AioSession()
config = botocore.client.Config(connect_timeout=10, read_timeout=10)
async with aioboto_session.create_client('s3', config=config) as s3_client, \ |
See also https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html It would help if IDE tool tips and/or code completion were working better for these objects. It seems like the nested factory creation patterns obscure things that are otherwise common place. A snippet to set or update the session default client config: default_config = botocore.client.Config(
connect_timeout=20,
read_timeout=120,
max_pool_connections=25,
region_name="us-west-2"
)
# aiosession.get_default_client_config() is Optional[botocore.client.Config]
client_config = aiosession.get_default_client_config()
if client_config:
client_config = client_config.merge(default_config)
else:
client_config = default_config
aiosession.set_default_client_config(client_config) |
pretty much all the aiobotocore methods follow the botocore docs, so you can use the botocore docs, no point in us replicating all their docs. |
o i c you're saying so like |
Related to this - updated some client creation functions in dazza-codes/aio-aws#13 - in that PR, there is examples of some pydocs with sphinx code examples to illustrate how to pass some optional args or kwargs and a link to the botocore docs. Most that project code uses type hints that help too. It seems like PyCharm does not pick up on the |
ideally we find a way to forward the help docs across á la wrapt |
btw i tested via |
The code to call lambda and read a response has been working fine for most workloads. I ran into this while load testing with some modest lambda payloads and longer runtimes; approx 350 Mb and 25 seconds runtime (not too crazy).
The code is at https://github.com/dazza-codes/aio-aws/blob/master/aio_aws/aio_aws_lambda.py#L145-L221 and that module has a simple main example. The version details are below and aiobotocore is at 1.2.1
I've tried to remember and retrace the deeply nested creation of a client to figure out how to configure and/or pass some kind of timeout object all the way down to the aiohttp session, but I can't find it. When using aiohttp directly it's something like the following link notes [1], but what would be the same kind of thing for aiobotocore and could this be documented (or did I miss it already)?
[1] - https://docs.aiohttp.org/en/stable/client_quickstart.html#timeouts
Is there any way to pass any timeout args to a
steam.read()
call for a lambda response?traceback:
versions
The text was updated successfully, but these errors were encountered: