core/homeassistant
Stefan Agner f0006b92be
Allow to lock SQLite database during backup (#60874)
* Allow to set CONF_DB_URL

This is useful for test which need a custom DB path.

* Introduce write_lock_db helper to lock SQLite database

* Introduce Websocket API which allows to lock database during backup

* Fix isort

* Avoid mutable default arguments

* Address pylint issues

* Avoid holding executor thread

* Set unlock event in case timeout occures

This makes sure the database is left unlocked even in case of a race
condition.

* Add more unit tests

* Address new pylint errors

* Lower timeout to speedup tests

* Introduce queue overflow test

* Unlock database if necessary

This makes sure that the test runs through in case locking actually
succeeds (and the test fails).

* Make DB_LOCK_TIMEOUT a global

There is no good reason for this to be an argument. The recorder needs
to pick a sensible value.

* Add Websocket Timeout test

* Test lock_database() return

* Update homeassistant/components/recorder/__init__.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Fix format

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-12-07 13:16:24 +01:00
..
auth Handle errors response to be None (#60679) 2021-12-01 13:51:10 +01:00
backports Move StrEnum to homeassistant.backports and move Platform to homeassistant.const (#60880) 2021-12-03 09:31:17 +01:00
components Allow to lock SQLite database during backup (#60874) 2021-12-07 13:16:24 +01:00
generated Revert "Add Open-Meteo integration (#60379)" (#61130) 2021-12-06 23:35:14 +01:00
helpers Prevent log flooding in frame helper (#61085) 2021-12-06 15:26:31 -08:00
scripts
util Add debug logging for pip install command (#61057) 2021-12-05 13:30:02 -08:00
__init__.py
__main__.py Activate fault handler (#56550) 2021-09-28 00:05:06 -07:00
async_timeout_backcompat.py
block_async_io.py
bootstrap.py
config.py
config_entries.py Move MqttServiceInfo to init.py (#60905) 2021-12-03 19:34:48 +01:00
const.py 2022! Happy New Year! (#60936) 2021-12-03 21:06:14 +01:00
core.py
data_entry_flow.py
exceptions.py
loader.py
package_constraints.txt Block pytest_asyncio (#61141) 2021-12-06 22:07:56 -08:00
requirements.py
runner.py
setup.py Move StrEnum to homeassistant.backports and move Platform to homeassistant.const (#60880) 2021-12-03 09:31:17 +01:00
strings.json