Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shut down / restart appdaemon does not terminate in correct order #2016

Open
mmattel opened this issue Aug 18, 2024 · 0 comments
Open

Shut down / restart appdaemon does not terminate in correct order #2016

mmattel opened this issue Aug 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mmattel
Copy link

mmattel commented Aug 18, 2024

What happened?

When you shut down appdaemon or restart it, you have the ability to do a cleanup using the terminate() function in an app. But the order in which the shutdown steps are made are imho not correct. It shuts down the connection to HA first instead processing the therminate() steps. This leads to the situation that you cant set entities in HA as part of the cleanup.

Current:

INFO AppDaemon: SIGTERM Received
INFO AppDaemon: AppDaemon is shutting down
INFO HASS: Disconnecting from Home Assistant
...
INFO AppDaemon: Calling terminate() for my_app
WARNING HASS: Attempt to call Home Assistant while disconnected: set_plugin_state

Imho, the order should be the following:

INFO AppDaemon: SIGTERM Received
INFO AppDaemon: Calling terminate() for my_app
INFO AppDaemon: AppDaemon is shutting down
INFO HASS: Disconnecting from Home Assistant
...

Version

4.4.2

Installation type

Home Assistant add-on

Relevant log output

No response

Relevant code in the app or config file that caused the issue

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant