|
@@ -1274,8 +1274,6 @@ public class ClientCnxn {
|
|
+ Long.toHexString(getSessionId()));
|
|
+ Long.toHexString(getSessionId()));
|
|
}
|
|
}
|
|
|
|
|
|
- closing = true;
|
|
|
|
-
|
|
|
|
try {
|
|
try {
|
|
RequestHeader h = new RequestHeader();
|
|
RequestHeader h = new RequestHeader();
|
|
h.setType(ZooDefs.OpCode.closeSession);
|
|
h.setType(ZooDefs.OpCode.closeSession);
|
|
@@ -1323,9 +1321,14 @@ public class ClientCnxn {
|
|
packet.ctx = ctx;
|
|
packet.ctx = ctx;
|
|
packet.clientPath = clientPath;
|
|
packet.clientPath = clientPath;
|
|
packet.serverPath = serverPath;
|
|
packet.serverPath = serverPath;
|
|
- if (!zooKeeper.state.isAlive()) {
|
|
|
|
|
|
+ if (!zooKeeper.state.isAlive() || closing) {
|
|
conLossPacket(packet);
|
|
conLossPacket(packet);
|
|
} else {
|
|
} else {
|
|
|
|
+ // If the client is asking to close the session then
|
|
|
|
+ // mark as closing
|
|
|
|
+ if (h.getType() == OpCode.closeSession) {
|
|
|
|
+ closing = true;
|
|
|
|
+ }
|
|
outgoingQueue.add(packet);
|
|
outgoingQueue.add(packet);
|
|
}
|
|
}
|
|
}
|
|
}
|