Fixed catching InterruptedException in config-subsystem and netconf.
In netconf persister propagate interrupted exception as it indicates
that netconf connection was not established and thus config pushing
does not work.
Change-Id: I7934bddd2b7c6591d1a4557a60df39a6de15dc72
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
try {
Thread.sleep(ATTEMPT_TIMEOUT_MS);
} catch (InterruptedException e1) {
+ Thread.currentThread().interrupt();
throw new RuntimeException(e1);
}
continue;
ignoredMissingCapabilityRegex);
jmxNotificationHandler.init();
} catch (InterruptedException e) {
- logger.info("Interrupted while waiting for netconf connection");
+ Thread.currentThread().interrupt();
+ logger.error("Interrupted while waiting for netconf connection");
+ // uncaught exception handler will deal with this failure
+ throw new RuntimeException("Interrupted while waiting for netconf connection", e);
}
}
};
try {
return sessionListener.getLastMessage(attempts, attemptMsDelay);
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
throw new RuntimeException(this + " Cannot read message from " + address, e);
} catch (IllegalStateException e) {
throw new IllegalStateException(this + " Cannot read message from " + address, e);
netconf_ssh_input.join();
}
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
logger.error("netconf_ssh_input join error ",e);
}
netconf_ssh_output.join();
}
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
logger.error("netconf_ssh_output join error ",e);
}
try {
lock.wait();
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}