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
69.62k stars 28.8k forks source link

Sqlalchemy trace during restart #117004

Open chemelli74 opened 1 month ago

chemelli74 commented 1 month ago

The problem

After upgrading to 2024.5.2 during shutdown I often (80% - 90%) see te attached log line.

What version of Home Assistant Core has the issue?

2024.5.2

What was the last working version of Home Assistant Core?

2024.5.1

What type of installation are you running?

Home Assistant Core

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?

2024-05-07 15:23:02.388 WARNING (Recorder) [homeassistant.util.executor] Thread[DbWorker_0] is still running at shutdown: File "/usr/local/lib/python3.12/threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self._dialect.do_close(connection)
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 702, in do_close
    dbapi_connection.close()

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (recorder) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `recorder` 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 recorder` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


recorder documentation recorder source (message by IssueLinks)

bdraco commented 1 month ago

It might be that shutdown is too fast now and the database executor is shutdown too late