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

Sqlalchemy connection close hangs during restart #117004

Closed
chemelli74 opened this issue May 7, 2024 · 3 comments
Closed

Sqlalchemy connection close hangs during restart #117004

chemelli74 opened this issue May 7, 2024 · 3 comments

Comments

@chemelli74
Copy link
Contributor

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
Copy link

home-assistant bot commented May 7, 2024

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
Copy link
Member

bdraco commented May 12, 2024

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

bdraco added a commit that referenced this issue May 13, 2024
@bdraco bdraco changed the title Sqlalchemy trace during restart Sqlalchemy connection close hangs during restart Jul 10, 2024
@chemelli74
Copy link
Contributor Author

Updated to 2024.7.2 and cannot reproduce any more. Thx @bdraco for the fix !

@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants