Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/fbuild-daemon/src/handlers/operations/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,19 @@ pub async fn deploy(
};

ctx.serial_manager.detach_reader(&monitor_port, &request_id);
// Detaching the reader alone leaves the session -- and its OS serial
// handle -- open forever, so the next client gets EBUSY on a board
// that is enumerated and perfectly healthy. The monitor and WebSocket
// cleanup paths both schedule the physical close here; this one did
// not, which is why the leak only showed up after a deploy.
// See FastLED/fbuild#1426.
if !ctx.serial_manager.has_clients(&monitor_port) {
ctx.serial_manager.close_port_after_grace_if_idle(
&monitor_port,
&request_id,
std::time::Duration::from_secs(2),
);
}

return match monitor_result {
MonitorOutcome::Success(msg) => (
Expand Down
Loading