ZOOKEEPER-3766 zkServer and other scripts should export CLASSPATH rather than use -cp
Motivation
ZooKeeper's launch scripts use -cp to pass the class path to Java when launching. This creates insanely large command-lines which are completely unnecessary.
Java respects the CLASSPATH environment variable, and this is how the class path should be passed to Java when the process launches.
So, instead of doing java -cp $CLASSPATH ..., the scripts should be doing export CLASSPATH; java ....
The long command-lines make it difficult to troubleshoot, or view running process lists in tools like top, htop, ps, but also make it impossible to search and manage using tools like pgrep and pkill, which can only search for the first 4096 characters in the command-line. (See https://github.com/apache/fluo-uno/issues/243#issuecomment-601553260 for a specific issue involving this limit caused by ZK's scripts.)
Master issue: ZOOKEEPER-3766
Thanks for the review and the help @ctubbsii
I don't think the test failing in the CI is related to my fix
I don't think the test failing in the CI is related to my fix
The complete build is still very flaky, and has been for some time. However, the ZooKeeper project has an strong interest in ensuring that changes don't cause regressions. I agree that it does seem unrelated to your changes, but the nature of your changes being what they are, it's still possible that they could have affected the build in some way. You can try to force a rebuild by closing and reopening the PR, or by running git commit --amend --reset-author to update the timestamp on your commit message, and doing a force push.
Any update on this? This would be really helpful.
This PR can be closed. It has been superseded by #2224