-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Load botocore i/o methods in executor #1196
base: master
Are you sure you want to change the base?
Conversation
logger.debug( | ||
"AioClientCreator - Method load_service_model[botocore] could generate I/O. Running in executor: %s", | ||
load_executor, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to add this to the documentation instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
logger.debug( | ||
"AioSession - Method load_service_model[botocore] could generate I/O. Running in executor: %s", | ||
self.load_executor, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for creating the PR.
Having taken a brief look, several concerns prevent me from supporting this proposal at this time:
- Unless absolutely necessary, we should avoid making any changes to the signature of upstream functions and classes, in particular public APIs. This proposal introduces several API changes, including to
create_client()
. While they might well be backwards compatible, they introduce drift and might make it more difficult to stay up-to-date with future botocore releases. - botocore (and by extension aiobotocore) has a powerful configuration mechanism that could (should?) be used instead.
- As far as I can tell, the botocore loader is far more complex and has a lot more blocking codepaths than are considered here. Having a fully async loader would be preferable to me. I have started work in that area, but it will be a massive change and I am not sure I can pull through and finish it.
Here's a recent example of adding a configuration option: #1102 |
Check https://github.com/boto/botocore/blob/develop/botocore/loaders.py to get a glimpse of the number of I/O operations that exist and might need to be run in the executor. If you then identify all calling code throughout aiobotocore/botocore the task of avoiding any blocking calls becomes daunting, at least to me. |
For your reference, I have pushed a branch with progress on fully async loaders to https://github.com/jakob-keller/aiobotocore/tree/async-loaders. This is nowhere near complete, though. |
So if I go that way, are you willing to add the change ? |
That would only address 1. and 2. I feel we should have a discussion about 3. before more effort is invested in this or any other PR. But that is just my opinion. |
I would say that is a start. What you think ? |
What specific issue are you referencing? When #1120 was discussed, no consensus was reached that this is even an issue with aiobotocore. |
I don't know what to say or add. The issue is made evident by HA, Please help me understanding what is the missing information. |
First of all, I am not aware that a related issue has been raised with aiobotocore. This might well be a technicality, but that would be the ideal place to clarify where the issue lies, if there are any work arounds available and/or whether and how to best address it. Discussing the apparent issue, potential solutions and a proposed fix in the context of a PR has not worked well for #1120 and I feel this PR might be on a similar path. I suggest to open an issue and continue the discussion there. Thank you! |
Done, #1199 |
@@ -37,6 +42,7 @@ def __init__( | |||
event_hooks=None, | |||
include_builtin_handlers=True, | |||
profile=None, | |||
load_executor=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of this being a bool, you should just pass in the executor you want to use for the loader, that way you avoid defaulting to creating a ton of threads
Description of Change
Follow-up of #1120
Added the option to load in the executor
botocore
methods that do I/O.To enable the new approach is enough to call
nothing changes for all current downstream implementations of this library as default is False and thus is not needed to be specified.
Assumptions
Replace this text with any assumptions made (if any)
Checklist for All Submissions
Checklist when updating botocore and/or aiohttp versions