coordinator/client: add lease-based place locking#9
Draft
idan-arm wants to merge 8 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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