Open MartinHjelmare opened 1 month ago
Hey there @thomas55555, mind taking a look at this issue as it has been labeled with an integration (husqvarna_automower
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
husqvarna_automower documentation husqvarna_automower source (message by IssueLinks)
The problem
Problem
If there's an error when connecting the websocket the coordinator will retry after sleeping a bit. The retry is done in a recursive fashion in the same task by calling
client_listen
again. If the integration isn't reloaded for a long time the risk increases that eventually the coordinator will hit maximum recursion limit since the same task is recursing more and more on every connection problem even if there are successful connections in between.Solution
Instead of recursing in the same task the coordinator should create a new background task for the call to
client_listen
on retry.Problem code
https://github.com/home-assistant/core/blob/d16a2fac80b5e3e897442bef786d89e4aa393a94/homeassistant/components/husqvarna_automower/coordinator.py#L62-L87
What version of Home Assistant Core has the issue?
core-2024.7.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Husqvarna Automower
Link to integration documentation on our website
https://www.home-assistant.io/integrations/husqvarna_automower/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response