zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-3766 zkServer and other scripts should export CLASSPATH rather than use -cp

Open mino181295 opened this issue 5 years ago • 5 comments

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

mino181295 avatar Nov 11 '20 01:11 mino181295

Thanks for the review and the help @ctubbsii

mino181295 avatar Nov 11 '20 09:11 mino181295

I don't think the test failing in the CI is related to my fix

mino181295 avatar Nov 11 '20 22:11 mino181295

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.

ctubbsii avatar Nov 12 '20 02:11 ctubbsii

Any update on this? This would be really helpful.

ctubbsii avatar Dec 08 '20 14:12 ctubbsii

This PR can be closed. It has been superseded by #2224

ctubbsii avatar Mar 26 '25 11:03 ctubbsii