Skip to content

fix: skip corrupted state.json in list_runs() instead of aborting - #3904

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/list-runs-error-handling
Open

fix: skip corrupted state.json in list_runs() instead of aborting#3904
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/list-runs-error-handling

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Problem

If any single state.json file is corrupted, truncated, or unreadable, the unhandled exception aborts the entire iteration and all subsequent valid runs are never listed.

Fix

Catch OSError, JSONDecodeError, and UnicodeDecodeError to skip bad entries gracefully.

Testing

  • Verified that valid runs are still listed correctly
  • Verified that a corrupted state.json is skipped without crashing

If any single state.json file is corrupted, truncated, or unreadable,
the unhandled exception aborts the entire iteration and all subsequent
valid runs are never listed. Catch OSError, JSONDecodeError, and
UnicodeDecodeError to skip bad entries gracefully.
@Quratulain-bilal
Quratulain-bilal requested a review from mnriem as a code owner July 31, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant