fix: dispatcher crash on invalid failure_stage + per-task error isolation

Two fixes:
1. db_layer.update_task_status: map invalid failure_stage values (e.g.
   'process' from Edge) to 'callback' before DB write, preventing
   MariaDB ENUM DataError (1265 "Data truncated")
2. dispatcher._poll_once: wrap each task dispatch in try/except so one
   task's failure doesn't skip remaining tasks in the batch

Root cause: Edge returns failure_stage='process' but DB ENUM only allows
  download/extract/vlm_visual/vlm_fusion/callback. The DataError crashed
  _poll_once(), causing all subsequent PENDING tasks to be skipped.
This commit is contained in:
ericwyuan
2026-08-20 11:09:10 +08:00
parent 853cb21542
commit d75c745b95
2 changed files with 7 additions and 1 deletions

View File

@@ -165,7 +165,10 @@ class Dispatcher:
tasks = db_layer.get_pending_tasks(limit=10)
for task in tasks:
if self._should_retry(task):
self._dispatch_one(task)
try:
self._dispatch_one(task)
except Exception as e:
logger.error(f"[task_id={task['task_id']}] dispatch 异常: {e}", exc_info=True)
def _run(self):
"""线程主循环"""