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_r339307942
 
 

 ##########
 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:
   Can we use the helper methods to generate the expected values instead of 
hard coding them 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:
[email protected]


With regards,
Apache Git Services

Reply via email to