[ 
https://issues.apache.org/jira/browse/KAFKA-9362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17008172#comment-17008172
 ] 

ASF GitHub Bot commented on KAFKA-9362:
---------------------------------------

avermeer commented on pull request #7896: KAFKA-9362: Missing GC logs when 
running Kafka with Java 11 with OpenJ9 VM
URL: https://github.com/apache/kafka/pull/7896
 
 
   Modified `bin/kafka-run-class.sh` to use Java 8-like way of enabling GC logs 
when using a Java version based on OpenJ9 JVM, because this JVM does not 
support JEP 158 new options for GC logging.
   
   To test the change, I ran the Quickstart with various types of Java:
   * ORACLE Java 8
   * AdoptOpenJDK8 with HotSpot
   * AdoptOpenJDK11 with HotSpot
   * AdoptOpenJDK8 with OpenJ9
   * AdoptOpenJDK11 with OpenJ9
   
   Without this PR, running Quickstart with AdoptOpenJDK11 with OpenJ9 led to 
`JVMJ9VM085W`  errors in Zookeeper and in Kafka server output, and no GC logs 
were generated. With this PR, there are no more OpenJ9 errors and GC logs are 
produced as expected.
   
   Also ran the graddle tests just for non-reg.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Missing GC logs when running Kafka with Java 11 with OpenJ9 VM
> --------------------------------------------------------------
>
>                 Key: KAFKA-9362
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9362
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.1.1, 2.2.2, 2.4.0, 2.3.1
>         Environment: AdoptOpenJDK11.0.5 (LTS release) on Linux, Windows, etc.
>            Reporter: Alexandre Vermeerbergen
>            Priority: Major
>              Labels: OpenJ9
>             Fix For: 2.1.2, 2.2.3, 2.5.0, 2.3.2, 2.4.1
>
>
> When running Kafka server with a Java 11 JRE based on OpenJ9 JVM (instead of 
> usual HotSpot), we get this message in output:
> $ ./bin/zookeeper-server-start.sh config/zookeeper.properties
> JVMJ9VM085W Malformed option: 
> '-Xlog:gc*:file=/home/data/ave/Java/kafka_2.12-2.4.0/bin/../logs/zookeeper-gc.log:time'
> [2020-01-03 12:46:35,575] INFO Reading configuration from: 
> config/zookeeper.properties 
> (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
> [2020-01-03 12:46:35,576] WARN config/zookeeper.properties is relative. 
> Prepend ./ to indicate that you're sure! 
> (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
> [2020-01-03 12:46:35,577] INFO clientPortAddress is 0.0.0.0/0.0.0.0:2181 
> (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
> ...
> and likewise when running '{{bin}}{{/kafka-server-start}}{{.sh 
> config}}{{/server}}{{.properties}}'
> While this does not prevent Kafka server (and its Zookeeper server) from 
> running, it has the effect that GC logs are not written, making diagnostics 
> harder than when running Kafka with a Java 11 based on HotSpot JVM.
> This is because OpenJ9 does not implements JEP 158, and thus even Java 11 
> versions based on OpenJ9 still rely on the same GC logging options as Java 8.
> I believe that it is easy to fix this issue by making a change to 
> [https://github.com/apache/kafka/blob/trunk/bin/kafka-run-class.sh,] lines 
> 295-299:
>  if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then
>  
> KAFKA_GC_LOG_OPTS="-Xlog:gc*:file=$LOG_DIR/$GC_LOG_FILE_NAME:time,tags:filecount=10,filesize=102400"
>  else
>  KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc 
> -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps 
> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
>  fi
> which could be replaced by:
>  JAVA_VM_ISJ9=$($JAVA -version 2>&1|grep J9)
>  if [[ "$JAVA_MAJOR_VERSION" -ge "9" || -n "$JAVA_VM_ISJ9" ]] ; then
>  
> KAFKA_GC_LOG_OPTS="-Xlog:gc*:file=$LOG_DIR/$GC_LOG_FILE_NAME:time,tags:filecount=10,filesize=102400"
>  else
>  KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc 
> -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps 
> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
>  fi
> Please let me know if that sounds good to you.
> Please note that IBM AIX Java is also based on OpenJ9, so fixing this issue 
> would also nice for AIX users !
> Kind regards,
> Alexandre
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to