Skip to content

fix(async): close #813 audit gaps (#815/#817/#818) + confirm #816/#819/#820/#821#842

Merged
zackees merged 1 commit into
mainfrom
fix/async-followups-813
Jun 29, 2026
Merged

fix(async): close #813 audit gaps (#815/#817/#818) + confirm #816/#819/#820/#821#842
zackees merged 1 commit into
mainfrom
fix/async-followups-813

Conversation

@zackees

@zackees zackees commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

Final follow-up to #813's whole-app tokio runtime migration. PR #823 already landed the bulk of the conversion; this PR closes the last three gap-laden audit sub-issues and confirms the four that verified clean.

Verification + fixes by sub-issue

Verified clean (no work needed, closing on this PR):

Gaps fixed in this PR:

  • audit: sync code that could be async in fbuild-daemon (sub-issue of #813) #815 fbuild-daemon — daemon emulator handlers had 8+ sync std::fs::* calls running on the axum worker; export_artifacts_bundle (with sync I/O) was called outside spawn_blocking from build + deploy handlers. Fixed: converted 4 emulator handler files to tokio::fs::* (one helper flipped sync → async); wrapped 3 export_artifacts_bundle call sites in spawn_blocking. The broker IPC backend (broker/backend.rs) keeps its std::thread::spawn model intentionally — it's a sync IPC protocol, not on the tokio runtime by design.

  • audit: sync code that could be async in fbuild-cli + fbuild-python (sub-issue of #813) #817 fbuild-python — 7 sync helpers still had ~30-line reqwest::blocking::Client blocks duplicated alongside Async* counterparts. Folded each into 1-2 line rt.block_on(async_version(...)) wrappers; extracted 4 shared async helpers; deleted unused intermediate sync wrappers. Zero reqwest::blocking::* references remain in fbuild-python/src/.

  • audit: cross-cutting async/sync architecture (sub-issue of #813) #818 cross-cutting — last structural piece was BuildLog.sender: Option<std::sync::mpsc::Sender<String>> requiring a spawn_blocking bridge in the daemon's build handler. Flipped to tokio::sync::mpsc::UnboundedSender<String> and deleted the 10-line bridge task; the WebSocket forwarder now awaits log_rx.recv() directly.

Test plan

  • `soldr cargo check --workspace --all-targets` — clean
  • `soldr cargo clippy --workspace --all-targets -- -D warnings` — clean
  • `soldr cargo test --workspace --no-fail-fast` — exit 0

Closes

🤖 Generated with Claude Code

Three parallel fix-ups completing the whole-app tokio runtime
migration audit:

#815 fbuild-daemon — emulator handler fs/wraps:
- avr8js_deploy.rs: 5 std::fs::* calls → tokio::fs::*.await
- avr8js_web.rs: 2 std::fs::read_to_string → tokio::fs::*.await;
  load_session_manifest flipped sync → async; in-file callers updated
- qemu_deploy.rs: std::fs::create_dir_all → tokio::fs::*.await
- avr8js_npm.rs: ensure_avr8js_npm_in inner create_dir_all converted;
  prepare_avr8js_cache_for_install kept sync (test-callable) and its
  sole async caller wraps it in spawn_blocking
- export_artifacts_bundle (3 call sites in build.rs + deploy.rs)
  wrapped in spawn_blocking so its sync std::fs::* I/O doesn't run
  on the axum worker

#817 fbuild-python — 7 sync helpers folded into block_on(async_version):
- serial_monitor.rs: reset_device now reuses post_reset_request_async
- daemon.rs: verify_broker_daemon_cache_identity, ensure_running_via_broker,
  ensure_running, stop, status all share async helpers
- outcome.rs: send_op now folds into send_op_async
- ~30-line duplicated sync HTTP blocks collapsed to 1-2 lines each;
  no more reqwest::blocking::* in fbuild-python/src/

#818 cross-cutting — BuildLog channel flipped to tokio:
- BuildLog.sender / BuildParams.log_sender:
  Option<std::sync::mpsc::Sender<String>>
    → Option<tokio::sync::mpsc::UnboundedSender<String>>
- daemon build handler bridge task (sync-mpsc → tokio-mpsc forwarder
  on spawn_blocking) deleted; replaced with a direct tokio::spawn
  forwarder that awaits log_rx.recv()
- Test fixtures updated to use tokio::sync::mpsc::unbounded_channel

Closes #815, #816, #817, #818, #819, #820, #821 (all sub-issues
of #813 confirmed addressed; #816/#819/#820/#821 had no remaining
work by verification, #815/#817/#818 fixed here).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zackees, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f8317030-a9a6-496e-8416-deee4e01a1a2

📥 Commits

Reviewing files that changed from the base of the PR and between e1b4486 and 8ce4548.

📒 Files selected for processing (13)
  • crates/fbuild-build/src/build_output.rs
  • crates/fbuild-build/src/lib.rs
  • crates/fbuild-core/src/build_log.rs
  • crates/fbuild-daemon/src/handlers/emulator/avr8js_deploy.rs
  • crates/fbuild-daemon/src/handlers/emulator/avr8js_npm.rs
  • crates/fbuild-daemon/src/handlers/emulator/avr8js_web.rs
  • crates/fbuild-daemon/src/handlers/emulator/qemu_deploy.rs
  • crates/fbuild-daemon/src/handlers/operations/build.rs
  • crates/fbuild-daemon/src/handlers/operations/deploy.rs
  • crates/fbuild-python/src/async_serial_monitor.rs
  • crates/fbuild-python/src/daemon.rs
  • crates/fbuild-python/src/outcome.rs
  • crates/fbuild-python/src/serial_monitor.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/async-followups-813

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees zackees merged commit 596ae19 into main Jun 29, 2026
83 of 93 checks passed
@zackees zackees deleted the fix/async-followups-813 branch June 29, 2026 19:39
zackees added a commit that referenced this pull request Jun 29, 2026
Releases the post-#813 / #802 / #826 / #844 work landed across:
- PR #843 — workspace-wide timeout sweep (#802 family)
- PR #837, #849, #850, #851 — internal-bridges + dylint sweep (#826 + #844)
- PR #842 — async migration follow-ups (#813)

15 dylints now ship in dylints/ (4 from earlier, 10 from #826/#844,
plus the renamed ban_unwrap_in_production). 7 internal bridge APIs:
fbuild_core::{http, fs, time, channel, path::canonicalize_existing},
fbuild_paths::temp_subdir, fbuild_cli::output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment