Repository navigation
Closed
Description
Summary
While validating FastLED after upgrading to fbuild==2.3.13, the fbuild daemon panicked on a Tokio worker thread with the nested-runtime error from fbuild-core::subprocess::block_on.
This appears separate from #811: the serial monitor did reconnect successfully after reset/preemption, but the daemon still logged a runtime panic during the same AutoResearch validation flow.
Repro context
FastLED command:
bash autoresearch esp32s3 --all --skip-lint --timeout 240Environment observed:
- Windows host
- fbuild 2.3.13 from PyPI
- Board/port:
esp32s3onCOM22 - FastLED AutoResearch build/deploy succeeded, then RPC validation used fbuild serial and reset paths
Daemon log excerpt
2026-06-29T16:50:36.166889Z INFO fbuild_serial::manager: port opened successfully port="COM22" client_id="c313b557-a0b1-4bda-b008-34ad2d6d750a" attempt=0
2026-06-29T16:50:36.731391Z INFO fbuild_daemon: Daemon staying alive: 1 open serial session, 1 pending serial attach
thread 'tokio-rt-worker' (39332) panicked at crates\fbuild-core\src\subprocess.rs:256:8:
Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2026-06-29T16:50:56.903163Z INFO fbuild_daemon: Periodic cleanup: cleared 1 stale project lock(s)
2026-06-29T16:51:07.340839Z INFO fbuild_serial::manager: background reader stopped port="COM22"
2026-06-29T16:51:07.341893Z INFO fbuild_serial::manager: port closed port="COM22" client_id="deploy_preemption"
2026-06-29T16:51:07.566326Z INFO fbuild_serial::manager: port opened successfully port="COM22" client_id="c313b557-a0b1-4bda-b008-34ad2d6d750a" attempt=0
Investigation notes
- The panic site is
crates/fbuild-core/src/subprocess.rs:256, inside the_blockingsubprocess bridge. - The daemon reset handler already uses
tokio::task::spawn_blocking(...)aroundfbuild_deploy::reset::reset_device(...), so the panic may be from another daemon worker path. - The only non-test production callers of the
_blockingsubprocess bridge I found are incrates/fbuild-packages/src/disk_cache/budget.rs, where disk size probing calls PowerShell viafbuild_core::subprocess::run_command_blocking(...)on Windows. - The comment in
subprocess.rsalready says these blocking helpers must not be called from inside an async runtime; the daemon still reached that state.
Expected behavior
Daemon-side code should not panic when it needs a subprocess-backed disk/cache probe during an async request or background task. Either the caller should stay on an async subprocess API, or the blocking helper should detect an existing runtime and use an async-safe blocking boundary.
Acceptance criteria
- Running the FastLED AutoResearch flow above does not log
Cannot start a runtime from within a runtime. - Daemon paths that compute cache budgets or disk size on Windows avoid calling
run_command_blocking(...)from Tokio worker threads. - A regression test covers invoking the relevant budget/disk-size path from inside a Tokio runtime.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsTriage
Activity