Skip to content

fix(realfs): avoid blocking async runtimes#2205

Merged
chaliy merged 1 commit into
mainfrom
codex/fix-realfs-async-runtime
Jul 25, 2026
Merged

fix(realfs): avoid blocking async runtimes#2205
chaliy merged 1 commit into
mainfrom
codex/fix-realfs-async-runtime

Conversation

@chaliy

@chaliy chaliy commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What changed

RealFs async backend operations now use Tokio filesystem APIs throughout, preventing host filesystem work from blocking current-thread runtimes. Async construction is available through RealFs::open; the synchronous RealFs::new migration shim is deprecated.

Async JavaScript mount paths use the nonblocking constructor. Existing synchronous Rust builder, Python, and JavaScript factory surfaces remain operational during migration.

Why

Synchronous path resolution and metadata work inside async RealFs operations could stall or deadlock a single-worker Tokio runtime. The deterministic regression combines captured custom-builtin pipeline output with a FIFO-backed RealFs path.

Before / After

Before: the current-thread regression timed out after 500 ms because synchronous FIFO opening blocked the only runtime worker; the same test passed on a multi-thread runtime and masked the defect.

After: both current-thread and multi-thread pipeline tests complete in about 60 ms, while containment, symlink, read-only, and read-write semantics remain covered.

Risk

  • Medium
  • RealFs path-resolution timing and the recommended Rust constructor change. The deprecated constructor preserves source compatibility; focused security and cross-language tests cover existing behavior.

Validation

  • just pre-pr
  • RealFs unit tests: 39 passed
  • RealFs integration/runtime tests: 38 passed
  • Node tests: 520 passed; TypeScript build/typecheck passed
  • Python ABI3 wheel built; Python 3.9, 3.12, and 3.14 sync/async RealFs smoke tests passed
  • WASM build/tests and parallel-execution benchmark passed during investigation

Checklist

  • Tests added or updated
  • Backward compatibility considered

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 4e16a71 Commit Preview URL

Branch Preview URL
Jul 25 2026, 11:18 PM

@chaliy
chaliy merged commit c968eb8 into main Jul 25, 2026
40 checks passed
@chaliy
chaliy deleted the codex/fix-realfs-async-runtime branch July 25, 2026 23:29
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