Vinzenz Feenstra has uploaded a new change for review.
Change subject: Migration cancellation on timeout
......................................................................
Migration cancellation on timeout
During migrations the configured value of migration_timeout is not honoured
in the sense that we are not aborting the migration if it takes longer
than the configured value of conf.migration_timeout
Bug-Url:
https://bugzilla.redhat.com/970645
Change-Id: Ieb8fc80f0e592e20db7408615bcb95786f5e23b8
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 16 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/09/21409/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index e4dd392..268021a 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -733,9 +733,11 @@
self._vm.log.debug('starting migration monitor thread')
- lastProgressTime = time.time()
+ startTime = time.time()
+ lastProgressTime = startTime
smallest_dataRemaining = None
progress_timeout = config.getint('vars',
'migration_progress_timeout')
+ migration_timeout = config.getint('vars', 'migration_timeout')
while not self._stop.isSet():
self._stop.wait(self._MIGRATION_MONITOR_INTERVAL)
@@ -744,15 +746,26 @@
memTotal, memProcessed, memRemaining,
fileTotal, fileProcessed, _) = self._vm._dom.jobInfo()
+ now = time.time()
+ abort = False
if (smallest_dataRemaining is None or
smallest_dataRemaining > dataRemaining):
smallest_dataRemaining = dataRemaining
- lastProgressTime = time.time()
+ lastProgressTime = now
elif (time.time() - lastProgressTime) > progress_timeout:
# Migration is stuck, abort
self._vm.log.warn(
'Migration is stuck: Hasn\'t progressed in %s seconds. '
- 'Aborting.' % (time.time() - lastProgressTime))
+ 'Aborting.' % (now - lastProgressTime))
+ abort = True
+ elif now - startTime > migration_timeout:
+ self._vm.log.warn(
+ 'The migration took already %s seconds which is longer '
+ 'than the configured migration_timeout value (%s seconds).'
+ ' Aborting.', now - lastProgressTime, migration_timeout)
+ abort = True
+
+ if abort:
self._vm._dom.abortJob()
self.stop()
break
--
To view, visit
http://gerrit.ovirt.org/21409
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb8fc80f0e592e20db7408615bcb95786f5e23b8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>