Skip to content

Commit bb6a2b2

Browse files
committed
remote/coordinator: report expired lease extension
Reject lease extension requests with a specific expired-reservation error when the reservation timeout has already passed. This avoids returning the generic "not in leased state" error before the scheduler has processed the expired reservation.
1 parent 2a001b5 commit bb6a2b2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎labgrid/remote/coordinator.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,12 @@ async def ExtendLease(self, request, context, *, identity):
15161516
f"Reservation {token} is owned by a different user",
15171517
)
15181518

1519+
if reservation.expired:
1520+
await context.abort(
1521+
grpc.StatusCode.FAILED_PRECONDITION,
1522+
f"Reservation {token} has expired",
1523+
)
1524+
15191525
if reservation.state is not ReservationState.leased:
15201526
await context.abort(
15211527
grpc.StatusCode.FAILED_PRECONDITION,

0 commit comments

Comments
 (0)