home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.34k stars 29.88k forks source link

Blocking call in google calendar integration #96432

Closed pvmil closed 1 year ago

pvmil commented 1 year ago

The problem

The home assistant log complains about a blocking call in several integrations, including the Google Calendarintegration. I will submit other issues for Envoy(HACS), Squeezebox, and hassio

Logger: homeassistant.util.async Source: util/async.py:166 First occurred: 9 juli 2023 om 22:13:04 (4 occurrences) Last logged: 16:26:32

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue for google doing blocking calls at homeassistant/components/google/calendar.py, line 273: return await self.sync.store_service.async_get_timeline(

What version of Home Assistant Core has the issue?

2023.7.1

What was the last working version of Home Assistant Core?

I do not know, I think the issue has been in for multiple months (I did not use the card 24/7 before that)

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Calendar

Link to integration documentation on our website

https://www.home-assistant.io/integrations/google

Diagnostics information

Logger: homeassistant.util.async Source: util/async.py:166 First occurred: 9 juli 2023 om 22:13:04 (4 occurrences) Last logged: 16:26:32

Example YAML snippet

n.a.

Anything in the logs that might be useful for us?

n.a.

Additional information

If I can provide more information / perform a test please share

home-assistant[bot] commented 1 year ago

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (google) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `google` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign google` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


google documentation google source (message by IssueLinks)

allenporter commented 1 year ago

Hi, Is there any more detail? That is not a blocking call, or is it sleeping, so that is surprising. Do you have some kind of profiling or debugging enabled? This integration is used by thousands of folks and i haven't seen a report of this yet so its quite surprising.

pvmil commented 1 year ago

Thanks for your very fast response, I do not have profiling or debugging enabled. A restart of HA does not reproduce the issue

Log also containing other integrations: I see this for more integrations, complete log: Logger: homeassistant.util.async Source: util/async.py:166 First occurred: 9 juli 2023 om 22:13:04 (4 occurrences) Last logged: 16:26:32

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for enphase_envoy doing blocking calls at custom_components/enphase_envoy/envoy_reader.py, line 193: resp = await client.get( Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue for hassio doing blocking calls at homeassistant/components/hassio/handler.py, line 534: request = await self.websession.request( Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue for google doing blocking calls at homeassistant/components/google/calendar.py, line 273: return await self.sync.store_service.async_get_timeline( Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue for squeezebox doing blocking calls at homeassistant/components/squeezebox/media_player.py, line 152: await player.async_update()

allenporter commented 1 year ago

Interesting, none of the other ones look like sleep calls either.

allenporter commented 1 year ago

Perhaps a custom component is messing with something? FWIW diagnostics asked for in the issue template is looking for https://www.home-assistant.io/integrations/diagnostics/

pvmil commented 1 year ago

The issue with Envoy is created here. https://github.com/briancmpbll/home_assistant_custom_envoy/issues/101 No response on that one yet. There's no diagnostics button for google calendar or the envoy integration

pvmil commented 1 year ago

I am not able to reproduce this, or find related issues causing the problem. If from code perspective no reasoning can be found (this also was the feedback on Envoy plugin) this can be closed in my opinion