Skip to content

coordinator/client: add lease-based place locking#9

Draft
idan-arm wants to merge 8 commits into
masterfrom
coordinator-client/lease-based-locking
Draft

coordinator/client: add lease-based place locking#9
idan-arm wants to merge 8 commits into
masterfrom
coordinator-client/lease-based-locking

Conversation

@idan-arm
Copy link
Copy Markdown
Collaborator

@idan-arm idan-arm commented Jan 29, 2026

Background:
Labgrid currently supports reservations and place acquisition, but all place locks are effectively indefinite. When a reservation is removed or expires, any place acquired under that reservation may remain locked, requiring manual cleanup.
This MR introduces lease-based place locking, allowing places to be acquired for a limited time and released automatically when the reservation expires or is cancelled.
This integrates naturally with the existing reservation and scheduler semantics and avoids stale locks.

Overview:
This change adds a new lease acquisition mode alongside the existing acquire mode:

Acquire - default behaviour, locks a place indefinitely
Lease - time-limited lock, requires an active reservation and must
be extended explicitly
Leased places are released automatically when the associated reservation expires or is cancelled.

CLI examples
Create a reservation:
labgrid-client reserve board=imx8 # Create a reservation; the LG_TOKEN will be printed upon success
Lease a place using lock --mode=lease:
labgrid-client -p +<LG_TOKEN> lock --mode=lease
Lease a place using the dedicated lease command:
labgrid-client -p +<LG_TOKEN> lease
Extend the reservation to keep the lease alive:
labgrid-client extend <LG_TOKEN> --interval 60
Acquire a place indefinitely (unchanged behaviour):
labgrid-client -p board-01 lock
or
labgrid-client -p board-01 acquire

ep1cman and others added 8 commits January 29, 2026 09:12
Some forms of reset can reset the device into different modes. For example:
- Reboot
- Reboot into bootloader mode
- Reboot into recovery mode

Signed-off-by: Sebastian Goscik <sebastian.goscik@arm.com>
ADB is expected to be installed and working on the exporter and client machines.
For screensharing "scrcpy" needs to be installed on the client.

Signed-off-by: Sebastian Goscik <sebastian.goscik@arm.com>
This aligns with how commands and arguments are treated for SSH.

Signed-off-by: freedrikp <freedrikp@users.noreply.github.com>
Print to stdout when the exporter and coordinator are ready. External
programs can detect this and the coordinators listening port.
@alextercete alextercete marked this pull request as draft February 4, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants