Arik Hadas has uploaded a new change for review. Change subject: core: fix incorrect value of migrating_to_vds ......................................................................
core: fix incorrect value of migrating_to_vds Since we retried to switch host to maintenance as part of the monitoring thread but before the updated data from the monitoring was saved, the migrating_to_vds could have been overridden and set back to its previous value. This bug caused NPE in VURTI#handOver method sometimes and sometimes it produced a VM which is not migrating with some wrong value in its migrating_to_vds field. The solution is to retry to switch host to maintenance in the after-refresh-treatment part of the monitoring. Change-Id: I423d573ae5251d3058bdfb778a2b486ac5ea0090 Bug-Url: https://bugzilla.redhat.com/1112359 Signed-off-by: Arik Hadas <[email protected]> (cherry picked from commit a2982af5c58b487b2b5597c0d1bf2fd405d23d80) --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java 1 file changed, 11 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/31721/1 diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java index da7c0df..5b2f8eb 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java @@ -127,6 +127,7 @@ private boolean processHardwareCapsNeeded; private boolean refreshedCapabilities = false; private static Map<Guid, Long> hostDownTimes = new HashMap<>(); + private boolean vdsMaintenanceTimeoutOccurred; private static final Log log = LogFactory.getLog(VdsUpdateRunTimeInfo.class); @@ -534,6 +535,10 @@ markIsSetNonOperationalExecuted(); } + if (vdsMaintenanceTimeoutOccurred) { + handleVdsMaintenanceTimeout(); + } + if (_vds.getStatus() == VDSStatus.Maintenance) { try { getVdsEventListener().vdsMovedToMaintenance(_vds); @@ -601,6 +606,11 @@ logFailureMessage("ResourceManager::RerunFailedCommand:", ex); log.error(ExceptionUtils.getMessage(ex), ex); } + } + + private void handleVdsMaintenanceTimeout() { + getVdsEventListener().handleVdsMaintenanceTimeout(_vds); + _vdsManager.calculateNextMaintenanceAttemptTime(); } private void markIsSetNonOperationalExecuted() { @@ -1976,10 +1986,7 @@ _vds.getId(), _vds.getName()); } else { - if (_vdsManager.isTimeToRetryMaintenance()) { - ResourceManager.getInstance().getEventListener().handleVdsMaintenanceTimeout(_vds); - _vdsManager.calculateNextMaintenanceAttemptTime(); - } + vdsMaintenanceTimeoutOccurred = _vdsManager.isTimeToRetryMaintenance(); } } } -- To view, visit http://gerrit.ovirt.org/31721 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I423d573ae5251d3058bdfb778a2b486ac5ea0090 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
