-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Fix detected blocking call inside the event loop #1120
Conversation
sessions should be cached for the life of use so if this is a major issue the session should be kept around for a longer time. really botocore needs to speed this up on their end because it's way too slow |
Until then we have a fix anyway. |
I'm hesitant of doing this as |
It does looks like
|
Any feedback @thehesiod ? Thank you in advance |
so this seems like an issue with the aws component, why doesn't it do the session/client creation during |
like i was saying, it should cache the session/client there, or if you don't want to hold onto the client, perhaps just pre-warm up the botocore cache |
actually, this is invalid as botocore is not thread safe, with this you could have two requests, running in two different threads, trying to initialize the cache at the same time. closing |
@chemelli74 Thanks for trying to fix this. This problem must be solved eventually (unless the intent is WONTFIX). Please open an issue instead to track this in the long term. Thanks. |
ya let me know if I missed something, I truly believe this is a botocore issue. The fact they're reading a ton of JSON files is unsustainable. probably should be done on the fly per service when you use it...and even then should be in a post-processed state, like their build should generate python code based on those json files. |
so I looked a little into this, it seems like they use an |
What about pathlib ? |
that uses aiofiles which just uses a threadpool again: https://github.com/Tinche/aiofiles/tree/main/src/aiofiles |
i guess at the aiofiles level though it doesn't matter. But it sounds like there's a better solution |
If you point me towards the solution you prefer, I'll try to work on it. EDIT: Opened issue on |
Description of Change
Fix detected blocking call inside the event loop. Reference HomeAssistant latest build:
Assumptions
none
Checklist for All Submissions
Checklist when updating botocore and/or aiohttp versions