-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
bugfix: fix startup failure of Server1.5.2 by using OpenJDK 11 #4874
Conversation
#4434 这个pr里改动了启动脚本,可以识别出jdk17,在jdk11上可以通用吗 |
fix seata_server.sh
6a1e738
to
f8b029e
Compare
可以的,你这里需要完善一下,这里脚本可能无法识别类似于 |
或许你来统一做好oraclejdk和openjdk的解析,然后先合并你的,我再合并你的代码,这样我那块就不用改动了 |
Codecov Report
@@ Coverage Diff @@
## develop #4874 +/- ##
=============================================
- Coverage 49.46% 49.44% -0.02%
+ Complexity 4126 4123 -3
=============================================
Files 733 733
Lines 26051 26051
Branches 3219 3219
=============================================
- Hits 12885 12880 -5
- Misses 11791 11793 +2
- Partials 1375 1378 +3
|
我测试了下,.sh应该没什么问题,.bat我这边按照你提的pr改的,我这边没法测试,暂时没其他改动。 |
if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then | ||
JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${BASEDIR}/logs/seata_gc.log:time,tags:filecount=10,filesize=102400" | ||
else | ||
JAVA_OPT="${JAVA_OPT} -Xloggc:${BASEDIR}/logs/seata_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M" |
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.
我建议不要用cms任何参数,不要使用cmsgc
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.
LGTM
@@ -128,11 +128,16 @@ JVM_MaxMetaspaceSize=$JVM_MaxMetaspaceSize | |||
JVM_MaxDirectMemorySize=$JVM_MaxDirectMemorySize | |||
LOADER_PATH=$LOADER_PATH | |||
JAVA_OPT="${JAVA_OPT} -server -Dloader.path=${LOADER_PATH:="../lib"} -Xmx${JVM_XMX:="2048m"} -Xms${JVM_XMS:="2048m"} -Xmn${JVM_XMN:="1024m"} -Xss${JVM_XSS:="512k"} -XX:SurvivorRatio=10 -XX:MetaspaceSize=${JVM_MetaspaceSize:="128m"} -XX:MaxMetaspaceSize=${JVM_MaxMetaspaceSize:="256m"} -XX:MaxDirectMemorySize=${JVM_MaxDirectMemorySize:=1024m} -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy" | |||
JAVA_OPT="${JAVA_OPT} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASEDIR}/logs/java_heapdump.hprof -XX:+DisableExplicitGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75" | |||
JAVA_OPT="${JAVA_OPT} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASEDIR}/logs/java_heapdump.hprof -XX:+DisableExplicitGC" |
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.
Why remove the CMS parameter? What are the GC types and default parameters for different JDK versions?
为什么去掉CMS参数,不同的JDK版本对应的GC类型和默认参数是啥?
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.
gc类型应该交给jdk默认或者用户侧指定,通过${JAVA_OPT}
@slievrly
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.
The docker image should be out of the box.
问题依旧存在 |
什么问题依然存在,截个图看下 |
…nto dev/fix_seata_server.sh
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.
LGTM
* '1103' of https://github.com/zw201913/seata: optimize: remove useless code (apache#5047) bugfix: fix startup failure of Server1.5.2 by using OpenJDK 11 (apache#4874) bugfix: insert value is all parsed as string in insert on duplicate (apache#5028) bugfix: global session is not change to Committed in saga mode (apache#5050)
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.
LGTM
Ⅰ. Describe what this PR did
解决在OpenJDK 11环境,seata-server.sh获取jdk版本问题
Ⅱ. Does this pull request fix one issue?
fixes #4849
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews