tillrohrmann commented on a change in pull request #9703: [FLINK-14038]Add 
default GC options for flink on yarn to facilitate debugging
URL: https://github.com/apache/flink/pull/9703#discussion_r337642329
 
 

 ##########
 File path: 
flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java
 ##########
 @@ -174,10 +174,26 @@ public void testConfigOverwrite() throws 
ClusterDeploymentException {
        @Test
        public void testSetupApplicationMasterContainer() {
                Configuration cfg = new Configuration();
+               cfg.setBoolean(CoreOptions.FLINK_JVM_DEFAULT_GC_LOGGING, true);
                YarnClusterDescriptor clusterDescriptor = 
createYarnClusterDescriptor(cfg);
 
                final String java = "$JAVA_HOME/bin/java";
                final String jvmmem = "-Xms424m -Xmx424m";
+               final String defaultGCLoggingOpts =
+                       "-Xloggc:" + ApplicationConstants.LOG_DIR_EXPANSION_VAR 
+ "/gc.log " +
+                       "-XX:+PrintGCApplicationStoppedTime " +
+                       "-XX:+PrintGCDetails " +
+                       "-XX:+PrintGCDateStamps " +
+                       "-XX:+UseGCLogFileRotation " +
+                       "-XX:NumberOfGCLogFiles=10 " +
+                       "-XX:GCLogFileSize=10M " +
+                       "-XX:+PrintPromotionFailure " +
+                       "-XX:+PrintGCCause";
+               final String heapdumpOpts =
+                       "-XX:+HeapDumpOnOutOfMemoryError " +
+                               
"-XX:HeapDumpPath=/tmp/test-flink-jm-heapdump.hprof " +
+                               "-XX:OnOutOfMemoryError=\"echo -e 
'OutOfMemoryError! Killing current process %p...\nCheck gc logs and heapdump 
file(/tmp/test-flink-jm-heapdump.hprof) for details.' > " +
+                               "<LOG_DIR>/jobmanager.err; kill -9 %p\"";
 
 Review comment:
   Would be great to deduplicate this part as well. For example, if we have a 
utility `getGCLoggingOpts(....)`, then we could use it here.

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to