Browse Source

print error level message one time when failed

Change the error level of the error message, fill the detail message
when parsing failed, like crc failed.

Save the lineage_parsing when parsing failed. Because it can save the
cached status, it will skip the failed files when reloading.

As a result, it will keep the failed lineage_parser. When the diretory
is deleted, it will be deleted. But it can help print the failed message
only one time.
tags/v1.1.0
luopengting 5 years ago
parent
commit
57c09cc2bd
3 changed files with 7 additions and 11 deletions
  1. +1
    -6
      mindinsight/lineagemgr/cache_item_updater.py
  2. +4
    -3
      mindinsight/lineagemgr/lineage_parser.py
  3. +2
    -2
      mindinsight/lineagemgr/summary/lineage_summary_analyzer.py

+ 1
- 6
mindinsight/lineagemgr/cache_item_updater.py View File

@@ -29,7 +29,7 @@ def update_lineage_object(data_manager, train_id, added_info: dict):
validate_added_info(added_info)
cache_item = data_manager.get_brief_train_job(train_id)
lineage_item = cache_item.get(key=LINEAGE, raise_exception=False)
if lineage_item is None:
if lineage_item is None or lineage_item.super_lineage_obj is None:
logger.warning("Cannot update the lineage for tran job %s, because it does not exist.", train_id)
raise ParamValueError("Cannot update the lineage for tran job %s, because it does not exist." % train_id)

@@ -63,11 +63,6 @@ class LineageCacheItemUpdater(BaseCacheItemUpdater):
self._delete_lineage_in_cache(cache_item, LINEAGE, relative_path)
return

super_lineage_obj = lineage_parser.super_lineage_obj
if super_lineage_obj is None:
logger.debug("There is no lineage to update in train job %s.", relative_path)
return

cache_item.set(key=LINEAGE, value=lineage_parser)

def _lineage_parsing(self, cache_item):


+ 4
- 3
mindinsight/lineagemgr/lineage_parser.py View File

@@ -121,10 +121,10 @@ class LineageParser:
except (LineageSummaryAnalyzeException,
LineageEventNotExistException,
LineageEventFieldNotExistException) as error:
logger.debug("Parse file failed, file_path is %s. Detail: %s", file_path, str(error))
logger.error("Parse file failed, file_path is %s. Detail: %s", file_path, str(error))
except MindInsightException as error:
logger.exception(error)
logger.debug("Parse file failed, file_path is %s.", file_path)
logger.error("Parse file failed, file_path is %s.", file_path)

def _init_if_files_deleted(self, file_list):
"""Init variables if files deleted."""
@@ -226,7 +226,8 @@ class LineageOrganizer:
for relative_dir, cache_train_job in cache_items.items():
try:
super_lineage_obj = cache_train_job.get("lineage").super_lineage_obj
self._super_lineage_objs.update({relative_dir: super_lineage_obj})
if super_lineage_obj is not None:
self._super_lineage_objs.update({relative_dir: super_lineage_obj})
except ParamValueError:
logger.debug("This is no lineage info in train job %s.", relative_dir)



+ 2
- 2
mindinsight/lineagemgr/summary/lineage_summary_analyzer.py View File

@@ -206,10 +206,10 @@ class LineageSummaryAnalyzer(SummaryAnalyzer):
lineage_info = analyzer.get_latest_info()
except (MindInsightException, IOError, DecodeError) as err:
log.debug(err_msg, file_path, str(err))
raise LineageSummaryAnalyzeException()
raise LineageSummaryAnalyzeException(str(err))
except Exception as err:
log.debug(err_msg, file_path, str(err))
raise LineageSummaryAnalyzeException()
raise LineageSummaryAnalyzeException(str(err))

return lineage_info



Loading…
Cancel
Save