From 1fd6cb4e154b8db886601ce8c43dde93ca26f03b Mon Sep 17 00:00:00 2001 From: Jakob van Santen Date: Thu, 27 May 2021 11:43:17 +0200 Subject: [PATCH] T2Processor: record exception provenance - Trouble doc includes process name - Event doc records success (i.e. no exceptions) This makes it easier to find T2 exceptions. --- ampel/t2/T2Processor.py | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ampel/t2/T2Processor.py b/ampel/t2/T2Processor.py index 5525c0383..1ca386d5d 100755 --- a/ampel/t2/T2Processor.py +++ b/ampel/t2/T2Processor.py @@ -225,6 +225,7 @@ def run(self, pre_check: bool = True) -> int: # Process t2 docs until next() returns None (breaks condition below) self._run = True + self._exception = False while self._run: # get t2 document (status is usually NEW or NEW_PRIO) @@ -245,7 +246,7 @@ def run(self, pre_check: bool = True) -> int: if garbage_collect: gc.collect() - event_doc.update(logger, docs=self._doc_counter, run=run_id) + event_doc.update(logger, docs=self._doc_counter, run=run_id, success=not self._exception) logger.flush() self.t2_instances.clear() @@ -834,12 +835,14 @@ def _processing_error(self, info: Dict[str, Any] = { **extra, + 'process': self.process_name, 'run': t2_rec['run'], 'stock': t2_doc['stock'], 'doc': t2_doc } if exception: + self._exception = True report_exception( self._ampel_db, logger=logger, exc=exception, info=info diff --git a/pyproject.toml b/pyproject.toml index b73b6725a..dcbd22bfc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ampel-core" -version = "0.7.2" +version = "0.7.3" description = "Asynchronous and Modular Platform with Execution Layers" authors = [ "Valery Brinnel"