* Limit concurrency of async_get_integration to avoid creating extra threads
Since async_get_integration is waiting on the disk most of the time
it would end up creating many new threads because the disk could
not deliver the data in time.
* pylint
* Detect lingering threads after tests
* Make sure cast is setup before checking state
* Make sure we ask executors of old hass to shutdown
We are not waiting here, just hoping for the best
* Make sure all instances of hass and executors is stopped.
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Also apply hass stopping to scripts
* Adjust to changes how we set up executor
* Add new CoreState.stopped
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Part 1 of 2 (no breaking changes in part 1).
When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.
This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.
Frontend Changes (home-assistant/frontend#6068)
* Address review comments
* bump timeout to 1800s, adjust comment
* bump timeout to 4h
* remove timeout failsafe
* and the test
* Periodicly log when intergrations are taking a while to setup
When one or more intergrations are taking a while to setup
it is hard to determine which one is the cause. We can
help narrow this down for the user with a periodic log
message about which domains are still waiting to be setup
every 30s.
* 30 -> 60 per discussion
* only log when the integration is actually doing setup
* reduce, fix race in test
* Proceed with startup if an integration setup blocks for more than 30m
* Fix test location
* Fix log call
* naming
* revert
* do not shield from cancelation
* Adjust test since we now cancel when we hit the timeout
* Use built in queue log handlers to avoid formatting logs in the event loop
Logging is now formatted and written in another thread to
ensure there is minimal impact on the event loop when
a log message is processed.
This change replaces the existing AsyncHandler log handler
as python 3.7+ now offers an off the shelf solution
* add a simple test
* s/async_migrate_log_handlers_to_queue/async_activate_log_queue_handler/g