[haizea-commit] r548 - trunk/src/haizea/resourcemanager

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Wed Nov 26 15:10:42 CST 2008


Author: borja
Date: 2008-11-26 15:10:36 -0600 (Wed, 26 Nov 2008)
New Revision: 548

Modified:
   trunk/src/haizea/resourcemanager/scheduler.py
Log:
Fixed bug where scheduler would crash in a pretty extreme corner case: a lease has to be scheduled in the future and the only reservation at the time happens to be a ShutdownResourceReservation. Since the scheduler is looking for VMRRs that are ending, it finds none.

Modified: trunk/src/haizea/resourcemanager/scheduler.py
===================================================================
--- trunk/src/haizea/resourcemanager/scheduler.py	2008-11-22 17:28:30 UTC (rev 547)
+++ trunk/src/haizea/resourcemanager/scheduler.py	2008-11-26 21:10:36 UTC (rev 548)
@@ -40,7 +40,7 @@
 import haizea.common.constants as constants
 from haizea.common.utils import round_datetime_delta, round_datetime, estimate_transfer_time, get_config, get_accounting, get_clock
 from haizea.resourcemanager.slottable import SlotTable, SlotFittingException
-from haizea.resourcemanager.datastruct import Lease, ARLease, BestEffortLease, ImmediateLease, ResourceReservation, VMResourceReservation, MigrationResourceReservation
+from haizea.resourcemanager.datastruct import Lease, ARLease, BestEffortLease, ImmediateLease, ResourceReservation, VMResourceReservation, MigrationResourceReservation, ShutdownResourceReservation
 from haizea.resourcemanager.resourcepool import ResourcePool, ResourcePoolWithReusableImages
 from operator import attrgetter, itemgetter
 from mx.DateTime import TimeDelta
@@ -662,6 +662,9 @@
         if allow_reservation_in_future:
             res = self.slottable.get_reservations_ending_after(changepoints[-1][0])
             futurecp = [r.get_final_end() for r in res if isinstance(r, VMResourceReservation)]
+            # Corner case: Sometimes we're right in the middle of a ShutdownReservation, so it won't be
+            # included in futurecp.
+            futurecp += [r.end for r in res if isinstance(r, ShutdownResourceReservation) and not r.vmrr in res]
             futurecp = [(p,None) for p in futurecp]
         else:
             futurecp = []



More information about the Haizea-commit mailing list