Skip to content

fix(serial): reject concurrent device operations - #1502

Merged
zackees merged 1 commit into
mainfrom
fix/1461-device-deploy-lease
Sep 27, 2026
Merged

zackees merged 1 commit into
mainfrom
fix/1461-device-deploy-lease

Conversation

@zackees

@zackees zackees commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • turn deploy/reset preemption into exclusive per-port ownership that rejects every competing request instead of overwriting the active holder
  • hold ownership through post-flash recovery and serialize serial-session publication/attachment with lease acquisition to close attach races
  • return HTTP 409 for conflicting deploy/reset requests and holder-aware WebSocket errors instead of misreporting a wedged driver
  • cover different-owner, duplicate-request-ID, atomic publication, concurrent deploy, and WebSocket diagnostic behavior

Validation

  • soldr cargo fmt --all -- --check
  • soldr cargo test -p fbuild-serial --lib preemption::tests
  • soldr cargo test -p fbuild-serial --lib manager::tests::concurrent_deploy_preemption_rejects_second_request_and_preserves_first
  • soldr cargo test -p fbuild-daemon --lib ws_attach_reports_active_deploy_holder_instead_of_driver_wedge
  • soldr cargo clippy -p fbuild-serial -p fbuild-daemon --all-targets -- -D warnings
  • pre-push clud-review: clean
  • bash test reached one unrelated wall-clock-sensitive Python test failure under concurrent compilation; its isolated rerun passed in 0.79s

Closes #1461

Hold per-port deploy/reset ownership through recovery, reject conflicting requests, and report active holders to serial clients. Serialize serial session publication with lease acquisition to close attach races.

Closes #1461
@zackees
zackees merged commit f2819cd into main Sep 27, 2026
16 of 18 checks passed
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

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

Review profile: CHILL

Plan: Advanced

Run ID: 17987d1e-a7ed-4c23-8d4f-10dcfd34a0a3

📥 Commits

Reviewing files that changed from the base of the PR and between d24ed5b and 4630a23.

📒 Files selected for processing (7)
  • crates/fbuild-daemon/src/handlers/operations/deploy.rs
  • crates/fbuild-daemon/src/handlers/operations/reset.rs
  • crates/fbuild-daemon/src/handlers/websockets.rs
  • crates/fbuild-daemon/src/handlers/websockets_tests.rs
  • crates/fbuild-serial/src/manager.rs
  • crates/fbuild-serial/src/manager/tests.rs
  • crates/fbuild-serial/src/preemption.rs

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.

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.

Daemon lets a second deploy preempt an in-flight deploy on the same port (no per-port lease); contention misreported as 'serial driver may be wedged'

1 participant