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

[SQL Sensor] partial revert of #12452 #12956

Merged
merged 2 commits into from Mar 7, 2018

Conversation

dgomes
Copy link
Contributor

@dgomes dgomes commented Mar 6, 2018

Description:

This PR addresses:
https://community.home-assistant.io/t/sql-sensor-errors-after-upgrade-to-0-64-3/45969

#12452 moved close() to immediately after the query execution, and was validated with test against MySQL. This worked well for databases that have connection pools (everyone except SQLite).

Explanation of the problem can be traced to:
http://docs.sqlalchemy.org/en/latest/core/pooling.html#sqlalchemy.pool.NullPool

The current PR, moves the session close() back to after all objects related to sqlalchemy can be invalidated.

Checklist:

  • The code change is tested and works locally.
  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@balloob balloob merged commit b04e7bb into home-assistant:dev Mar 7, 2018
@balloob balloob mentioned this pull request Mar 9, 2018
@dgomes dgomes deleted the sql_sensor_close branch March 10, 2018 11:47
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed integration: sql small-pr PRs with less than 30 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants