[haizea-commit] r787 - branches/1.1/src/haizea/core
haizea-commit at mailman.cs.uchicago.edu
haizea-commit at mailman.cs.uchicago.edu
Wed Jan 20 21:52:47 CST 2010
Author: borja
Date: 2010-01-20 21:52:47 -0600 (Wed, 20 Jan 2010)
New Revision: 787
Modified:
branches/1.1/src/haizea/core/leases.py
Log:
Allow premature ends to happen in the actual end (this can happen in weird corner cases)
Modified: branches/1.1/src/haizea/core/leases.py
===================================================================
--- branches/1.1/src/haizea/core/leases.py 2010-01-21 02:40:55 UTC (rev 786)
+++ branches/1.1/src/haizea/core/leases.py 2010-01-21 03:52:47 UTC (rev 787)
@@ -738,7 +738,7 @@
prev_time = vmrr.end
if vmrr.prematureend != None:
- assert vmrr.prematureend >= vmrr.start and vmrr.prematureend < vmrr.end
+ assert vmrr.prematureend >= vmrr.start and vmrr.prematureend <= vmrr.end
for post_rr in vmrr.post_rrs:
assert post_rr.start >= prev_time
@@ -778,14 +778,8 @@
for vmrr in self.vm_rrs:
if known != None:
rrdur = vmrr.end - vmrr.start
- if known - acc < rrdur:
+ if known - acc <= rrdur:
vmrr.prematureend = vmrr.start + (known-acc)
- # Kludgy, but this corner case actually does happen
- # (because of preemptions, it may turn out that
- # the premature end time coincides with the
- # starting time of the VMRR)
- if vmrr.prematureend == vmrr.start:
- vmrr.prematureend += TimeDelta(seconds=1)
break
else:
vmrr.prematureend = None
More information about the Haizea-commit
mailing list