-
Notifications
You must be signed in to change notification settings - Fork 5k
[BUG] Embed zookeeper server 'ZKServer' has deadlock problem #3140
Description
*For better global communication, please give priority to using English description, thx! *
Describe the bug
look at the code snippet
private static synchronized void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) {
if (zkServer != null) {
throw new RuntimeException("Zookeeper server is already started!");
}
zkServer = new PublicZooKeeperServerMain();
logger.info("Zookeeper data path : {} ", dataDirPath);
dataDir = dataDirPath;
final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns};
try {
logger.info("Zookeeper server started ");
isStarted.compareAndSet(false, true);
zkServer.initializeAndRun(args);
} catch (QuorumPeerConfig.ConfigException e) {
logger.warn("Caught exception while starting ZK", e);
} catch (IOException e) {
logger.warn("Caught exception while starting ZK", e);
}
}The above start method will acquire the lock of the ZKServer class. But the line "zkServer.initializeAndRun(args);" will block until the application exit. So it will never release the lock.
private static synchronized void stopLocalZkServer(final boolean deleteDataDir) {
// 省略
}The above stop method try to acquire the lock of the ZKServer class, but it will never succeed.
To Reproduce
Steps to reproduce the behavior, for example:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Which version of Dolphin Scheduler:
-[1.1.0-preview]
Additional context
Add any other context about the problem here.
**Requirement or improvement
- Please describe about your requirements or improvement suggestions.