Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

0.109 reports blocking I/O in the event loop #57

Closed
mdegat01 opened this issue Apr 29, 2020 · 8 comments · Fixed by #58
Closed

0.109 reports blocking I/O in the event loop #57

mdegat01 opened this issue Apr 29, 2020 · 8 comments · Fixed by #58
Assignees

Comments

@mdegat01
Copy link

Just updated to 0.109 and found this issue in my log
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for o365 doing I/O at custom_components/o365/calendar.py, line 158: limit=self.limit, query=query, include_recurring=True

In the release notes of 0.109 (as well as the log) HA team asks any instance of this log entry be reported as an issue on the component.

@mdegat01 mdegat01 changed the title 0.109 reports blocking I/O in hte event loop 0.109 reports blocking I/O in the event loop Apr 29, 2020
@jrnhrmn
Copy link

jrnhrmn commented May 1, 2020

Same here

@RogerSelwyn
Copy link
Contributor

and me, every 15 mins

@RogerSelwyn
Copy link
Contributor

I notice the setup in init.py isn't configured as async, (I think it should be async def async_setup...), but changing that didn't resolve the problem. So I think the issue is somewhere in the O365 module, which I'll try and do some debug against later. Not sure if it isn't just the fact of a problem with the way O365 queries work...

@PTST
Copy link
Owner

PTST commented May 2, 2020

Last i checked the O365 module was not async at all.

I will investigate when i have the time. But considering my daughter just arrived in the world, i honestly do not know when that will be

@RogerSelwyn
Copy link
Contributor

I'm planning to take a look. On the asynchronous subject, a number of methods in calendar.py are marked as async, and they seem to get called. Just seems the setup routine isn't async, not sure if it matters. I keep having to google what is achievable, so not sure if I can tell if the thing that is erroring it is actually async or not, I think it gets called from a couple of places. Just spending quality time with family who are off work, whilst I am still full time at my desk.

@RogerSelwyn
Copy link
Contributor

I will investigate when i have the time. But considering my daughter just arrived in the world, i honestly do not know when that will be

Congratulations by the way. Sleepless nights ahead, so I understand...

@PTST PTST self-assigned this May 2, 2020
@RogerSelwyn
Copy link
Contributor

I think the problem is that the calls to O365 are from inside an async routine, but possibly O365 is not async friendly. So I think you need to call them via a hass helper async_create_task as shown here https://developers.home-assistant.io/docs/asyncio_working_with_async. Not sure how many others items may need to be changed like that, I'm only using calendar.

Assuming you don't look at this overnight, I'll try to have a look tomorrow morning.

@unbreakmat
Copy link

2020-05-08 16:26:10 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for o365 doing I/O at custom_components/o365/calendar.py, line 158: limit=self.limit, query=query, include_recurring=True

same problem here

@PTST PTST linked a pull request May 11, 2020 that will close this issue
@PTST PTST closed this as completed in #58 May 11, 2020
PTST added a commit that referenced this issue May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants