use of org.dcache.alarms.PredefinedAlarm in project dcache by dCache.
the class PoolV4 method faultOccurred.
/**
* Called by subsystems upon serious faults.
*/
@Override
public void faultOccurred(FaultEvent event) {
Throwable cause = event.getCause();
String poolState;
PredefinedAlarm alarm;
switch(event.getAction()) {
case READONLY:
poolState = "Pool read-only: ";
disablePool(PoolV2Mode.DISABLED_RDONLY, 99, poolState + event.getMessage());
alarm = null;
break;
case DISABLED:
poolState = "Pool disabled: ";
disablePool(PoolV2Mode.DISABLED_STRICT, 99, poolState + event.getMessage());
alarm = PredefinedAlarm.POOL_DISABLED;
break;
default:
poolState = "Pool restart required: ";
disablePool(PoolV2Mode.DISABLED_STRICT | PoolV2Mode.DISABLED_DEAD, 666, poolState + event.getMessage());
alarm = PredefinedAlarm.POOL_DEAD;
break;
}
if (alarm != null) {
if (cause != null) {
LOGGER.error(AlarmMarkerFactory.getMarker(alarm, _poolName), "Pool: {}, fault occurred in {}: {}. {}, cause: {}", _poolName, event.getSource(), event.getMessage(), poolState, cause.toString());
} else {
LOGGER.error(AlarmMarkerFactory.getMarker(alarm, _poolName), "Pool: {}, fault occurred in {}: {}. {}", _poolName, event.getSource(), event.getMessage(), poolState);
}
}
}
Aggregations