Skip to content

Fix: reset document status to RUNNING when tasks recover from transient error#13293

Open
Br1an67 wants to merge 1 commit intoinfiniflow:mainfrom
Br1an67:fix/issue-13285-parsing-status
Open

Fix: reset document status to RUNNING when tasks recover from transient error#13293
Br1an67 wants to merge 1 commit intoinfiniflow:mainfrom
Br1an67:fix/issue-13285-parsing-status

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

What problem does this PR solve?

Fixes #13285

When a parsing task encounters a transient error (e.g., LLM overloaded), it temporarily sets task.progress = -1. If the periodic _sync_progress runs during this window, it marks the document as FAIL (doc.run = TaskStatus.FAIL). When the task recovers and continues processing (e.g., task.progress = 0.5), the next _sync_progress iteration reads status = doc.run (which is FAIL) as the default. Since finished = False (task is still running), neither the FAIL nor DONE branch updates the status, leaving the document stuck at FAIL even though processing is actively continuing.

This PR adds an explicit else clause in _sync_progress to reset the document status back to RUNNING when there are still unfinished tasks.

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):

When a task temporarily fails (progress=-1) and the periodic
update_progress sync marks the document as FAIL, the status was
not reset back to RUNNING when the task recovered and continued.
This happened because _sync_progress used doc.run as the default
status, and when finished=False, neither the FAIL nor DONE branch
updated it, leaving it stuck at FAIL.
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Mar 1, 2026
@tdakanalis
Copy link

Does your fix also handle the incorrect progress = -1.0 value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Inconsistent document parsing status after error recovery

2 participants