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
73.7k stars 30.83k forks source link

Settings -> Repairs -> Integration startup time is shown as negative #117530

Closed ildar170975 closed 6 months ago

ildar170975 commented 6 months ago

The problem

Settings -> Repairs -> Integration startup time a negative value is shown:

330937361-7268b4e5-e3dd-4143-864e-d1b6313bc9b2

What version of Home Assistant Core has the issue?

2024.5.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

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

bdraco commented 6 months ago

see https://github.com/home-assistant/core/issues/116221

ildar170975 commented 6 months ago

Your comment:

If platforms get loaded multiple times the calculation will be wrong.

If HA allows for platforms "get loaded multiple times" - then may be HA should consider these possible cases? I.e. this is not just a "problem in custom component", this is "HA does not consider this case".

bdraco commented 6 months ago

It's not possible to detect every incorrect way that an integration may write their code.

ildar170975 commented 6 months ago

t's not possible to detect every incorrect way that an integration may write their code.

Agree. But my point is: -- since some platform may be "get loaded multiple times" - then this could happen since HA allows to do it "multiple times"; -- then either HA should disable this possibility (i.e. a platform may be loaded one time only); -- or HA should consider these "get loaded multiple times" cases as a possible scenario when calculating a "startup time".

See, I know nothing about HA internals, my proposals are only based on you explanation.

bdraco commented 6 months ago

It wouldn’t make sense to try to work out the timings for a component that doesn’t await its platform setups since it has a much larger problem that it could get reloaded while its platforms are being setup. Once the component fixes that the timings will be correct.Since the custom component runs at the same privilege level as HA, there is nothing we can do to prevent a custom component from loading platforms without awaiting their setup. IMHO, it’s a good thing that it returns a nonsensical result since it makes it obvious there is a problem with the custom component that needs to be fixed as otherwise it would have probably gone unnoticed Sent from my iPhoneOn May 17, 2024, at 2:23 AM, ildar170975 @.***> wrote:

t's not possible to detect every incorrect way that an integration may write their code.

Agree. But my point is: -- since some platform may be "get loaded multiple times" - then this could happen since HA allows to do it "multiple times"; -- then either HA should disable this possibility (i.e. a platform may be loaded one time only); -- or HA should consider these "get loaded multiple times" cases as a possible scenario when calculating a "startup time". See, I know nothing about HA internals, my proposals are only based on you explanation.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ildar170975 commented 6 months ago

Thanks for explanation. Will open an issue for this integration.

ildar170975 commented 6 months ago

@bdraco Shall I close THIS issue?

For the record - issue for Gismeteo integration - https://github.com/Limych/ha-gismeteo/issues/191

bdraco commented 6 months ago

Yes

ildar170975 commented 6 months ago

Again for the record - the author of Gismeteo integration declines that this "negative startup time" could be a "integration issue". https://github.com/Limych/ha-gismeteo/issues/191#issuecomment-2117664356

yes, the time in your picture is strange, but this does not in any way affect the correctness of work of the integration. This means this is NOT an integration issue.