Currently if there are multiple KDCs defined for a realm, we send UDP request to each one and wait for reply, when no reply is received, we retry. After several unsuccessful retries, we go on to the next KDC. The timeout for the wait is normally 30 seconds. If the KDCs defined are not all turned on, the time spent to finally get a response might be very long. This is especially true for customers having a main KDC and several slave KDCs and the main KDC is in maintenance.
In fact, there is a better way to detect if the KDC server is on by connect() to it first. In this way, an IMCP PortUnreachableException will be thrown in a later send/receive method immediately. Also, when this exception is thrown, we can be sure that the KDC server is off and there is no need to retry this one.
Please note that if a KDC is on but for various reasons it cannot reply in a timely manner, we will still wait for the timeout and do a retry.