Skip to content

Commit

Permalink
fix: LEAP-1818: try to fix failing failure callback (#7033)
Browse files Browse the repository at this point in the history
  • Loading branch information
jombooth authored Feb 6, 2025
1 parent b4f40e6 commit e19eac9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions label_studio/data_export/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,13 @@ def set_convert_background_failure(job, connection, type, value, traceback_obj):
from data_export.models import ConvertedFormat

convert_id = job.args[0]
trace = tb.format_exception(type, value, traceback_obj)
ConvertedFormat.objects.filter(id=convert_id).update(status=Export.Status.FAILED, traceback=''.join(trace))
try:
trace = ''.join(tb.format_exception(type, value, traceback_obj))
except Exception as e:
if flag_set('fflag_fix_back_leap_1818_set_convert_background_failure_logging_02062025_short'):
logger.error(f'Failed to format traceback: {job=} {type=} {value=} {traceback_obj=} {e=}', exc_info=True)
trace = 'Exception while processing traceback. See stderr for details'
ConvertedFormat.objects.filter(id=convert_id).update(status=Export.Status.FAILED, traceback=trace)


@method_decorator(name='get', decorator=swagger_auto_schema(auto_schema=None))
Expand Down

0 comments on commit e19eac9

Please sign in to comment.