Skip to content

fix(deploy): wait for timed-out native espflash ops to release the port (#1614) - #1615

Merged
zackees merged 1 commit into
mainfrom
fix/1614-native-espflash-port-leak
Oct 2, 2026
Merged

zackees merged 1 commit into
mainfrom
fix/1614-native-espflash-port-leak

Conversation

@zackees

@zackees zackees commented Oct 2, 2026

Copy link
Copy Markdown
Member

The native verify/write paths ran espflash on spawn_blocking under
tokio::time::timeout. A timeout only drops the JoinHandle; the blocking
thread keeps running and keeps the serial port open until espflash gives
up on its own (~40s past the 30s verify budget on an ESP32-C6). The
esptool fallback then failed with EBUSY ("port is busy").

Route all three sites through run_port_bound, which on timeout keeps
joining the thread for a bounded release grace so the port is free
before the caller falls back, and reports the port as still held if the
grace expires. Fixes the comments that claimed the Flasher drops on
timeout.

Closes #1614

…rt (#1614)

The native verify/write paths ran espflash on spawn_blocking under
tokio::time::timeout. A timeout only drops the JoinHandle; the blocking
thread keeps running and keeps the serial port open until espflash gives
up on its own (~40s past the 30s verify budget on an ESP32-C6). The
esptool fallback then failed with EBUSY ("port is busy").

Route all three sites through run_port_bound, which on timeout keeps
joining the thread for a bounded release grace so the port is free
before the caller falls back, and reports the port as still held if the
grace expires. Fixes the comments that claimed the Flasher drops on
timeout.

Closes #1614
@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: FastLED/fbuild/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1bf36379-c367-40a7-aaf6-3af1aef37369

📥 Commits

Reviewing files that changed from the base of the PR and between 70e08e3 and 3f82872.

📒 Files selected for processing (3)
  • crates/fbuild-deploy/src/esp32/deployer.rs
  • crates/fbuild-deploy/src/esp32_native/blocking.rs
  • crates/fbuild-deploy/src/esp32_native/mod.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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 4f49540 into main Oct 2, 2026
24 checks passed
@zackees
zackees deleted the fix/1614-native-espflash-port-leak branch October 2, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

ESP32 native espflash timeout leaks the serial port to the esptool fallback (EBUSY)

1 participant