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.73k stars 29.98k forks source link

iAqualink integration causes HA to get hung at random intervals. #34268

Closed mcnutter1 closed 4 years ago

mcnutter1 commented 4 years ago

I had this issue last year where HA would just hang up and atop working when the iAqualink integration is enabled... sometimes after a day, sometimes after an hour. Through the Winter my pool was shut down and I disabled the integration... I re-enabled it the other day and the issue is happening again.

I'm running 108.3... I notice in the logs repeated messages saying iAqualink disconnected and reconnected quite frequently.

@flz I think you wrote this.

probot-home-assistant[bot] commented 4 years ago

Hey there @flz, mind taking a look at this issue as its been labeled with a integration (iaqualink) you are listed as a codeowner for? Thanks!

bdraco commented 4 years ago

@flz I've seen this blocking startup but not afterwards. We need more detail on errors you see in the log.

2020-04-22 21:09:43 WARNING (MainThread) [homeassistant.components.iaqualink] Exception raised while attempting to login: Cannot connect to host support.iaqualink.com:443 ssl:None [Connect call failed ('54.88.35.243', 443)]
balloob commented 4 years ago

Please do not remove the issue template. Put it back and fill it in.

flz commented 4 years ago

@mcnutter1 I have also seen disconnect/reconnect messages last week but no hanging issues. I would consider disabling integrations one by one until you figure out which one is causing hangs.

@bdraco I'll look at the code but AFAIR, the code should be non-blocking.

bdraco commented 4 years ago

@bdraco For clarity, my observation was that await aqualink.login() can take a while to timeout because the server is unresponsive. Lowering the timeout might make sense.

flz commented 4 years ago

@mcnutter1 Coincidentally, it looks like 0.109.0 might bring some light to this: https://www.home-assistant.io/blog/2020/04/29/release-109/ (see section on blocking i/o).

@bdraco It might take a while to time out but shouldn't block the main thread. Lowering the timeout might cause (slow) connections to fail due to (temporary?) issues such as network congestion. I've seen a bunch of timeouts happening since shelter-in-place mandates have become more widespread.

bdraco commented 4 years ago

@bdraco It might take a while to time out but shouldn't block the main thread.

Right it only delays (I should have said temporarily blocks) startup because HASS is waiting for all the config entries be ready. If it times out sooner it will raise ConfigEntryNotReady and then retry later when the api is in a better place and avoid delaying starting.

mcnutter1 commented 4 years ago

@flz. I was thinking the same about .109 and the blocking detection... I was eagerly waiting for it to GA to test. It certainly feels like something blocking or holding up the core process, I'm on .108.9 and it seems the UI hangs up for about a few minutes and then comes back, I have PRTG monitoring connectivity and I see timeouts and then it comes back on its own.

flz commented 4 years ago

@mcnutter1 Any more hangs?

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.