Handle exceptions thrown by background tasks

Fixes #3921
This commit is contained in:
Erik Johnston 2018-09-20 16:15:21 +01:00
parent 3fd68d533b
commit 9ea408441f
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ def run_as_background_process(desc, func, *args, **kwargs):
try: try:
yield func(*args, **kwargs) yield func(*args, **kwargs)
except Exception:
logger.exception("Background process '%s' threw an exception", desc)
finally: finally:
proc.update_metrics() proc.update_metrics()