diff --git a/homeassistant/components/recorder/__init__.py b/homeassistant/components/recorder/__init__.py index ba960dcb93d..4e3109c7dce 100644 --- a/homeassistant/components/recorder/__init__.py +++ b/homeassistant/components/recorder/__init__.py @@ -735,10 +735,13 @@ class Recorder(threading.Thread): """ size = self.queue.qsize() _LOGGER.debug("Recorder queue size is: %s", size) - if self.queue.qsize() <= MAX_QUEUE_BACKLOG: + if size <= MAX_QUEUE_BACKLOG: return _LOGGER.error( - "The recorder queue reached the maximum size of %s; Events are no longer being recorded", + "The recorder backlog queue reached the maximum size of %s events; " + "usually, the system is CPU bound, I/O bound, or the database " + "is corrupt due to a disk problem; The recorder will stop " + "recording events to avoid running out of memory", MAX_QUEUE_BACKLOG, ) self._async_stop_queue_watcher_and_event_listener() diff --git a/homeassistant/components/recorder/const.py b/homeassistant/components/recorder/const.py index 0fce9657624..20566862ec4 100644 --- a/homeassistant/components/recorder/const.py +++ b/homeassistant/components/recorder/const.py @@ -13,7 +13,7 @@ DOMAIN = "recorder" CONF_DB_INTEGRITY_CHECK = "db_integrity_check" -MAX_QUEUE_BACKLOG = 30000 +MAX_QUEUE_BACKLOG = 40000 # The maximum number of rows (events) we purge in one delete statement diff --git a/tests/components/recorder/test_websocket_api.py b/tests/components/recorder/test_websocket_api.py index 8385136967c..612593f71f9 100644 --- a/tests/components/recorder/test_websocket_api.py +++ b/tests/components/recorder/test_websocket_api.py @@ -278,7 +278,7 @@ async def test_recorder_info(hass, hass_ws_client): assert response["success"] assert response["result"] == { "backlog": 0, - "max_backlog": 30000, + "max_backlog": 40000, "migration_in_progress": False, "recording": True, "thread_running": True,