Skip to content

FIX Prevent blocking file I/O on async paths - #2452

Open
Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-fix-async-file-io
Open

FIX Prevent blocking file I/O on async paths#2452
Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-fix-async-file-io

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

Async backend, CLI, and dataset-loading paths were performing synchronous file and filesystem operations, which could block the event loop and serialize concurrent work.

This change moves straightforward asynchronous file reads and writes to aiofiles, and runs blocking JSON parsing, synchronous dataset loading, and path-heavy filesystem checks through asyncio.to_thread. Existing exception behavior, ordering, caching semantics, and public APIs are preserved.

Tests and Documentation

Added deterministic unit coverage for the new event-loop-safe boundaries in the version route, initializer upload flow, FigStep loader, and VLGuard loader.

Validated with the focused 86-test suite, Ruff format/check, changed-file ty, the async-suffix check, commit hooks, and git diff --check.

Documentation and JupyText: N/A.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

2 participants