Log unexpected exceptions causing recorder shutdown (#99445)

This commit is contained in:
Erik Montnemery 2023-09-02 16:51:06 +02:00 committed by GitHub
parent 9e9aa163f7
commit 7168e71860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -692,6 +692,10 @@ class Recorder(threading.Thread):
"""Run the recorder thread.""" """Run the recorder thread."""
try: try:
self._run() self._run()
except Exception: # pylint: disable=broad-exception-caught
_LOGGER.exception(
"Recorder._run threw unexpected exception, recorder shutting down"
)
finally: finally:
# Ensure shutdown happens cleanly if # Ensure shutdown happens cleanly if
# anything goes wrong in the run loop # anything goes wrong in the run loop