Skip to content

Commit 97af511

Browse files
committed
check for dependency only for modify in ExtendTicket
1 parent bc41825 commit 97af511

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

fabric_cf/actor/core/common/constants.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ class Constants:
7979
"""
8080
Constants
8181
"""
82-
RESERVATION_HAS_PENDING_OPERATION = -200001
83-
EXTEND_SAME_UNITS = -1
84-
ALL_RESERVATION_STATES = -1
8582
MANAGEMENT_API_TIMEOUT_IN_SECONDS = 120.0
8683

8784
CONTAINER_MANAGMENT_OBJECT_ID = "manager"

fabric_cf/actor/core/kernel/kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def extend_reservation(self, *, rid: ID, resources: ResourceSet, term: Term, dep
358358
real.lock()
359359
# check for a pending operation: we cannot service the extend if there is another operation in progress.
360360
if real.get_pending_state() != ReservationPendingStates.None_:
361-
return Constants.RESERVATION_HAS_PENDING_OPERATION
361+
raise KernelException(f"Reservation has a pending operation")
362362

363363
if isinstance(real, ReservationClient) and dependencies is not None:
364364
real.redeem_predecessors.clear()

fabric_cf/actor/core/kernel/reservation_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,12 +682,12 @@ def extend_ticket(self, *, actor: ABCActorMixin):
682682
else:
683683
self.error(err="Wrong state to initiate extend ticket: {}".format(ReservationStates(self.state).name))
684684

685-
# Extend Ticket is invoked by Probe
686-
if not self.can_ticket(extend=True):
685+
# Extend Ticket is invoked by Probe; Check dependencies only in case of modify
686+
# No new sliver is passed for renew and does not require dependency check
687+
if self.requested_resources.sliver is not None and not self.can_ticket(extend=True):
687688
self.transition_with_join(prefix="Extend ticket blocked", state=self.state,
688689
pending=self.pending_state, join_state=JoinState.BlockedExtendTicket)
689690
self.logger.info("Reservation has to wait for the dependencies to be extended!")
690-
print("Reservation has to wait for the dependencies to be extended!")
691691
return
692692

693693
self.sequence_ticket_out += 1

fabric_cf/orchestrator/core/orchestrator_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ def renew_slice(self, *, token: str, slice_id: str, new_lease_end_time: str):
676676
new_end_time=new_end_time,
677677
sliver=None)
678678
if not result:
679+
self.logger.error(f"Error: {controller.get_last_error()}")
679680
failed_to_extend_rid_list.append(r.get_reservation_id())
680681

681682
if len(failed_to_extend_rid_list) == 0:

0 commit comments

Comments
 (0)