Skip to content

Preserve exclusive device leases across daemon restarts - #2157

Merged
zackees merged 3 commits into
mainfrom
fix/device-lease-restart
Nov 23, 2026
Merged

zackees merged 3 commits into
mainfrom
fix/device-lease-restart

Conversation

@zackees

@zackees zackees commented Nov 23, 2026

Copy link
Copy Markdown
Member

Fixes #2150.

  • Save exclusive device reservations in the daemon data directory and restore the original lease IDs on startup.
  • Rebind tracked reservations after USB port renumbering and keep a replacement board at the old port independently addressable.
  • Add optional fbuild device lease --ttl-seconds for workflows that need automatic expiration. Explicit release and takeover update the saved reservations.

The restart regression exercises holder admission, competing acquisition, release by the original ID, USB port reuse, repeated renumbering, and expired leases.

The daemon suite passed 345 unit tests and 13 integration tests, including all 48 device-manager tests. A real USB board on a private daemon data directory reproduced the lost lease with the installed daemon. The patched daemon retained the lease ID after restart, rejected the competitor, and released the original lease.
A timed lease also expired across a real daemon restart, and its old ID could not release the next workflow's lease.

Fixes #2150

Ci-Attestation: {"at":1795398521,"gate":"rust/all/fmt","host":"linux-x86_64","key":"036190d003e833913cc9bd9893a305709cd8b70009d2f6664ce02280df2ef3f2","lane":"lint","parents":["9b1bf567c863d6dce01d0e2aaa1237cd39e920de"],"secs":2154,"stamp":"7d9340d4cc285b5513fb68d2cf25cfa5","tree":"ad29d25de5a7acd15b289198c21fe13b1b03c8bd","v":1,"via":"run"}
Ci-Attestation: {"at":1795398521,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"1551c08c606c5e723baea50f7cfd5d2f12819aa516fe29e3680a54ffb37e3b36","lane":"dylint","parents":["9b1bf567c863d6dce01d0e2aaa1237cd39e920de"],"secs":2154,"stamp":"0e1b1a955f18d33e29eb311d6fa1a8aa","tree":"ad29d25de5a7acd15b289198c21fe13b1b03c8bd","v":1,"via":"run"}
Ci-Attestation: {"at":1795398522,"gate":"rust/x86_64-unknown-linux-gnu/dylint","host":"linux-x86_64","key":"1551c08c606c5e723baea50f7cfd5d2f12819aa516fe29e3680a54ffb37e3b36","lane":"dylint","parents":["9b1bf567c863d6dce01d0e2aaa1237cd39e920de"],"secs":2154,"stamp":"0e3b2d272c2cc2efc714bf9368c00cda","tree":"ad29d25de5a7acd15b289198c21fe13b1b03c8bd","v":1,"via":"run"}
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@zackees
zackees added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 3844daa Nov 23, 2026
33 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 23, 2026
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.

Preserve exclusive device leases across daemon restarts

1 participant