fix(timeout): close #802 audit family — workspace-wide timeouts on blocking ops#843
Conversation
…ocking ops Comprehensive timeout sweep addressing all 9 open sub-issues of the #802 meta audit. Nine parallel agents worked on disjoint crate scopes; this commit consolidates their changes. #803 fbuild-serial: write_to_port + reader close wrapped in 2s tokio::time::timeout; esp_hard_reset gets 3s cap; preemption.rs uses std::sync::Mutex (never held across .await). #804 fbuild-deploy: native espflash entry points capped — write 180s, verify 30s, selective write 180s. #805 fbuild-packages: streaming body chunk reads get per-chunk 60s tokio::time::timeout; install_lock stale-after honors FBUILD_INSTALL_LOCK_STALE_SECS env override. #806 tests + benches: HIGH/MEDIUM async tests wrapped in tokio::time::timeout helpers; CLI integration tests use Child::try_wait poll deadlines. 15min budget for hardware-toolchain-download tests. #807 fbuild-core: subprocess::run_command* family resolves a default 15-min cap when caller passes None timeout (overridable via FBUILD_SUBPROCESS_DEFAULT_TIMEOUT_SECS); explicit run_command_no_timeout helpers added for legitimately-unbounded sites. publish_install_status wraps subscriber call in catch_unwind so panicking subscriber can't unwind into hot path. #808 fbuild-daemon: 14 handler / loop / channel sites bounded — build/deploy/install/monitor caps, WebSocket 10s attach handshake + 300s idle deadline, serialport::available_ports moved to spawn_blocking + 5s cap, broker session adopt/request 10s caps. #809 fbuild-build: 22 subprocess sites bounded — per-TU compile 300s, linkers 180s, archive 120s, objcopy 60s, nm/c++filt 30-60s, version probes 5s, esp32 elf2image / bootloader merges 30s. #810 fbuild-cli + fbuild-python: daemon-client build/shutdown caps; clang-tools subprocess output 120s; serial monitor WS handshake 5s across both sync + async surfaces. #812 CI scripts + workflows: timeout-minutes added across 20 GHA workflows; curl --max-time / --connect-timeout / --retry on uncapped download sites; pip install --timeout 60; subprocess.run timeout= kwargs added to 9 ci/ Python helpers. Also: const _: () = assert!(...) for compile-time bounds in subprocess.rs so clippy's assertions_on_constants doesn't fire. Closes #803, #804, #805, #806, #807, #808, #809, #810, #812. Closes #802 (meta — all sub-issues addressed). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (91)
📝 WalkthroughWalkthroughAdds explicit timeout/deadline enforcement across the entire fbuild system: a default subprocess timeout policy in ChangesSystem-wide timeout and deadline hardening
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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>
Summary
Comprehensive timeout sweep addressing all 9 open sub-issues of the #802 meta audit ("blocking operations with no timeout"). Nine parallel agents worked on disjoint crate scopes; this PR consolidates their changes.
What's in this PR (by sub-issue)
write_to_port+ reader close wrapped in 2stokio::time::timeout;esp_hard_reset3s cap;preemption.rsswitched tostd::sync::Mutex(never held across.await)tokio::time::timeout;install_lockhonorsFBUILD_INSTALL_LOCK_STALE_SECSenv overridetokio::time::timeouthelpers; CLI integration tests use Child::try_wait poll deadlinessubprocess::run_command*family resolves a default 15-min cap when caller passesNone(overridable viaFBUILD_SUBPROCESS_DEFAULT_TIMEOUT_SECS); explicitrun_command_no_timeouthelpers for legitimately-unbounded sites;publish_install_statuswraps subscriber incatch_unwindtimeout-minutesacross 20 GHA workflows; curl--max-time/--connect-timeout/--retry; pip--timeout 60; subprocess.runtimeout=kwargs in 9 ci/ helpersTest plan
soldr cargo check --workspace --all-targets— cleansoldr cargo clippy --workspace --all-targets -- -D warnings— cleansoldr cargo test --workspace --no-fail-fast— exit 0Deferred (out of scope, noted in agent reports)
interprocess::local_socket::Stream(v2.4.2) lacksset_read_timeout/set_write_timeout. Needs upstream API or rewrite to tokio-based local socket lib. Filed as follow-up consideration.Closes
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes