From 216cd7474b0a25c56a47a7061a4a0e744cf0da03 Mon Sep 17 00:00:00 2001 From: benni82 Date: Thu, 24 Apr 2025 11:44:34 +0800 Subject: [PATCH] fix: task_executor bug fix (#7253) ### What problem does this PR solve? The lock is not released correctly when task_exectuor is abnormal ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe): --- rag/svr/task_executor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.py index b1024fca6..0f8ffc161 100644 --- a/rag/svr/task_executor.py +++ b/rag/svr/task_executor.py @@ -674,6 +674,8 @@ async def report_status(): REDIS_CONN.delete(consumer_name) except Exception: logging.exception("report_status got exception") + finally: + redis_lock.release() await trio.sleep(30) @@ -702,6 +704,8 @@ def recover_pending_tasks(): stop_event.wait(60) except Exception: logging.warning("recover_pending_tasks got exception") + finally: + redis_lock.release() async def main():