Skip to content

Commit

Permalink
Use repr instead of str for monitoring fail history (#1966)
Browse files Browse the repository at this point in the history
repr is a better format for this field. For example, it usually
contains more context such as the exception class name:

>>> str(v)
'3'
>>> repr(v)
'KeyError(3)'
  • Loading branch information
benclifford authored Feb 11, 2021
1 parent 98c03b9 commit a423955
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parsl/dataflow/dflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def handle_exec_update(self, task_id, future):
logger.debug("Task {} try {} failed".format(task_id, task_record['try_id']))
# We keep the history separately, since the future itself could be
# tossed.
task_record['fail_history'].append(str(e))
task_record['fail_history'].append(repr(e))
task_record['fail_count'] += 1

if task_record['status'] == States.dep_fail:
Expand Down Expand Up @@ -368,7 +368,7 @@ def handle_join_update(self, outer_task_id, inner_app_future):
logger.debug("Task {} failed due to failure of inner join future".format(outer_task_id))
# We keep the history separately, since the future itself could be
# tossed.
task_record['fail_history'].append(str(e))
task_record['fail_history'].append(repr(e))
task_record['fail_count'] += 1

task_record['status'] = States.failed
Expand Down

0 comments on commit a423955

Please sign in to comment.