Skip to content

fix: handle TOCTOU race in list_runs state file read - #3838

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

fix: handle TOCTOU race in list_runs state file read#3838
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/list-runs-toctou

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Summary

Handle TOCTOU race where state.json is deleted between exists() check and open().

Changes

  • engine.py: Removed exists() guard, wrapped open/load in try/except to skip missing/corrupt state files

Remove exists() check and wrap open/load in try/except to handle the
case where state.json is deleted between the check and open. A missing
or corrupt state file now skips that run instead of crashing the
entire list_runs operation.
@Quratulain-bilal
Quratulain-bilal requested a review from mnriem as a code owner July 29, 2026 07:37
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