|
@@ -1197,11 +1197,14 @@ public class ClientCnxn {
|
|
|
}
|
|
|
|
|
|
if (to <= 0) {
|
|
|
- throw new SessionTimeoutException(
|
|
|
- "Client session timed out, have not heard from server in "
|
|
|
- + clientCnxnSocket.getIdleRecv() + "ms"
|
|
|
- + " for sessionid 0x"
|
|
|
- + Long.toHexString(sessionId));
|
|
|
+ String warnInfo;
|
|
|
+ warnInfo = "Client session timed out, have not heard from server in "
|
|
|
+ + clientCnxnSocket.getIdleRecv()
|
|
|
+ + "ms"
|
|
|
+ + " for sessionid 0x"
|
|
|
+ + Long.toHexString(sessionId);
|
|
|
+ LOG.warn(warnInfo);
|
|
|
+ throw new SessionTimeoutException(warnInfo);
|
|
|
}
|
|
|
if (state.isConnected()) {
|
|
|
//1000(1 second) is to prevent race condition missing to send the second ping
|
|
@@ -1382,9 +1385,12 @@ public class ClientCnxn {
|
|
|
Watcher.Event.EventType.None,
|
|
|
Watcher.Event.KeeperState.Expired, null));
|
|
|
eventThread.queueEventOfDeath();
|
|
|
- throw new SessionExpiredException(
|
|
|
- "Unable to reconnect to ZooKeeper service, session 0x"
|
|
|
- + Long.toHexString(sessionId) + " has expired");
|
|
|
+
|
|
|
+ String warnInfo;
|
|
|
+ warnInfo = "Unable to reconnect to ZooKeeper service, session 0x"
|
|
|
+ + Long.toHexString(sessionId) + " has expired";
|
|
|
+ LOG.warn(warnInfo);
|
|
|
+ throw new SessionExpiredException(warnInfo);
|
|
|
}
|
|
|
if (!readOnly && isRO) {
|
|
|
LOG.error("Read/write client got connected to read-only server");
|