Search in sources :

Example 1 with HostMonitoring

use of org.ovirt.engine.core.vdsbroker.monitoring.HostMonitoring in project ovirt-engine by oVirt.

the class VdsManager method refreshImpl.

public void refreshImpl() {
    boolean releaseLock = true;
    if (lockManager.acquireLock(monitoringLock).getFirst()) {
        try {
            setIsSetNonOperationalExecuted(false);
            synchronized (this) {
                refreshCachedVds();
                if (cachedVds == null) {
                    log.error("VdsManager::refreshVdsRunTimeInfo - onTimer is NULL for '{}'", getVdsId());
                    return;
                }
                try {
                    updateIteration();
                    if (isMonitoringNeeded()) {
                        setStartTime();
                        releaseLock = false;
                        hostMonitoring = new HostMonitoring(this, cachedVds, monitoringStrategy, resourceManager, dbFacade, auditLogDirector);
                        hostMonitoring.refresh();
                    }
                } catch (VDSNetworkException e) {
                    logNetworkException(e);
                    releaseLock = true;
                } catch (VDSRecoveringException ex) {
                    handleVdsRecoveringException(ex);
                    releaseLock = true;
                } catch (RuntimeException ex) {
                    logFailureMessage(ex);
                    releaseLock = true;
                }
            }
        } catch (Throwable t) {
            releaseLock = true;
            throw t;
        } finally {
            if (releaseLock) {
                lockManager.releaseLock(monitoringLock);
            }
        }
    }
}
Also used : HostMonitoring(org.ovirt.engine.core.vdsbroker.monitoring.HostMonitoring) VDSRecoveringException(org.ovirt.engine.core.vdsbroker.vdsbroker.VDSRecoveringException) VDSNetworkException(org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException)

Aggregations

HostMonitoring (org.ovirt.engine.core.vdsbroker.monitoring.HostMonitoring)1 VDSNetworkException (org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException)1 VDSRecoveringException (org.ovirt.engine.core.vdsbroker.vdsbroker.VDSRecoveringException)1