New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #550] Update java option setting to run in jdk9 #1035
Conversation
@husterxsp Hi,can you resolve the failed error check in your local enviroment. |
@zongtanghu Hi, I have just merged develop branch and all checks have passed currently. I'm not sure if it's ok now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I think we need to consider how to transfer old parameters in JDK8 to JDK9 and above, e.g. the GC log related parameters.
distribution/bin/runbroker.sh
Outdated
if [[ "$JAVA_MAJOR_VERSION" -lt 9 ]] ; then | ||
JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/dev/shm/mq_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy" | ||
JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m" | ||
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${BASE_DIR}/lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for curiosity, do we need to add ${BASE_DIR}/lib
to Djava.ext.dirs
if already added ${BASE_DIR}/lib
to CLASSPATH
when using JDK8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, and i've updated the commit.
JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m" | ||
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${BASE_DIR}/lib" | ||
else | ||
JAVA_OPT="${JAVA_OPT} --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to add some corresponding parameters of GC log for JDK9 and above here?
e.g. -Xlog:gc*:file=/dev/shm/mq_gc_%p.log:timemillis:filecount=5,filesize=30720
And other params like PrintGCApplicationStoppedTime and PrintAdaptiveSizePolicy are also needed to be transferred in JDK9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I‘m not very familiar with the parameters. According to https://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-BE93ABDC-999C-4CB5-A88B-1994AAAC74D5,maybe we can use -Xlog:safepoint
and -Xlog:ergo*=level
?
When can we expect this to be merged? This stops people from using JDK 9+. |
There is some code conflicts, in this pr, please resolve the conflicts firstyl. @husterxsp |
What is the purpose of the change
Fix issue #550、#436.
These are some reasons for the commit.
--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
In JDK9,after starting the broker, and then type ^C to shutdown it. I got exception as follow:
And when I restart by run
./bin/mqbroker
, the broker just don’t start, so add--add-exports
option to fix it.In addition, there are still some other problem.
/dev/shm
only exists in linux, and does not exist with mac and windows. And run on my mac will get warning:Cannot open file /dev/shm/mq_gc_pid9236.log due to No such file or directory.
Finally, I’ve test the commit in JDK 1.7.0_80、1.8.0_121、9.0.4、10.0.2、11.0.2 on my mac. if it’s all right, the cmd file is also need to be updated.
Brief changelog
Update java option setting to run in jdk9.
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.