You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can not commit or push code, so, just point out what the problem is and how to fix it.
The gui is very slow while we do any action on it, that's because every time it start up a new connection to zk server.
The problem exists in the com.deem.zkui.utils.ServletUtil.java's getZookeeper function.
It did not wait for the zk to establish connection to zk server.
'''
zk = ZooKeeperUtil.INSTANCE.createZKConnection(zkServer, zkSessionTimeout);
ZooKeeperUtil.INSTANCE.setDefaultAcl(globalProps.getProperty("defaultAcl"));
if (zk.getState() != ZooKeeper.States.CONNECTED) {
session.setAttribute("zk", null);
} else {
session.setAttribute("zk", zk);
}
'''
fix, add a sleep before check the connection status:
'''
zk = ZooKeeperUtil.INSTANCE.createZKConnection(zkServer, zkSessionTimeout);
ZooKeeperUtil.INSTANCE.setDefaultAcl(globalProps.getProperty("defaultAcl"));
while (zk.getState() == ZooKeeper.States.CONNECTING){
Thread.sleep(100);
}
if (zk.getState() != ZooKeeper.States.CONNECTED) {
session.setAttribute("zk", null);
} else {
session.setAttribute("zk", zk);
}
'''
The text was updated successfully, but these errors were encountered:
I can not commit or push code, so, just point out what the problem is and how to fix it.
The gui is very slow while we do any action on it, that's because every time it start up a new connection to zk server.
The problem exists in the com.deem.zkui.utils.ServletUtil.java's getZookeeper function.
It did not wait for the zk to establish connection to zk server.
'''
zk = ZooKeeperUtil.INSTANCE.createZKConnection(zkServer, zkSessionTimeout);
ZooKeeperUtil.INSTANCE.setDefaultAcl(globalProps.getProperty("defaultAcl"));
if (zk.getState() != ZooKeeper.States.CONNECTED) {
session.setAttribute("zk", null);
} else {
session.setAttribute("zk", zk);
}
'''
fix, add a sleep before check the connection status:
'''
zk = ZooKeeperUtil.INSTANCE.createZKConnection(zkServer, zkSessionTimeout);
ZooKeeperUtil.INSTANCE.setDefaultAcl(globalProps.getProperty("defaultAcl"));
while (zk.getState() == ZooKeeper.States.CONNECTING){
Thread.sleep(100);
}
if (zk.getState() != ZooKeeper.States.CONNECTED) {
session.setAttribute("zk", null);
} else {
session.setAttribute("zk", zk);
}
'''
The text was updated successfully, but these errors were encountered: