Skip to content

Offload synchronous filesystem I/O to asyncio.to_thread in LocalFSBackend #57

@mchades

Description

@mchades

Context

LocalFSBackend.execute() is async but performs synchronous filesystem I/O (iterdir, stat, read_bytes, write_bytes, mkdir) which blocks the event loop.

Scope

All four intent types are affected:

  • LOOKUP: read_bytes()
  • QUERY: iterdir(), stat()
  • INGEST: mkdir(), write_bytes(), write_text()
  • REVISE: read_bytes(), write_bytes()

Proposed Approach

Wrap blocking calls with asyncio.to_thread() or use aiofiles for file I/O.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions