From 4b5c3c1d20487dd42dac81c9582316ce17fa810e Mon Sep 17 00:00:00 2001 From: siraj-io <103127931+siraj-io@users.noreply.github.com> Date: Mon, 18 Nov 2024 17:04:29 +0530 Subject: [PATCH 1/2] Revert "check for no jfr variables" --- src/common/Chart.yaml | 2 +- src/common/templates/_jfr-helper.tpl | 30 ++-------------------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/common/Chart.yaml b/src/common/Chart.yaml index 8828d0f..f3860fe 100644 --- a/src/common/Chart.yaml +++ b/src/common/Chart.yaml @@ -15,7 +15,7 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.70 +version: 1.3.69 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/src/common/templates/_jfr-helper.tpl b/src/common/templates/_jfr-helper.tpl index 4fb37fa..3067a2c 100644 --- a/src/common/templates/_jfr-helper.tpl +++ b/src/common/templates/_jfr-helper.tpl @@ -4,12 +4,6 @@ USAGE: */}} {{- define "harnesscommon.jfr.v1.renderEnvironmentVars" }} {{- $ := .ctx }} -{{- $waitTime := "20" }} -{{- if hasKey $.Values "jfr" }} - {{- if hasKey $.Values.jfr "sleep" }} - {{- $waitTime = $.Values.jfr.sleep }} - {{- end }} -{{- end }} {{- if $.Values.global.jfr.enabled }} - name: POD_NAME valueFrom: @@ -21,8 +15,6 @@ USAGE: value: {{ default "default" $.Values.envType }} - name: JFR_DUMP_ROOT_LOCATION value: {{ default "/opt/harness" $.Values.jfrDumpRootLocation }} -- name: WAIT_TIME - value: {{ $waitTime }} {{- end }} {{- end }} @@ -50,7 +42,7 @@ preStop: - -c - | touch shutdown; - sleep ${WAIT_TIME}; + sleep 20; ts=$(date '+%s'); loc=${JFR_DUMP_ROOT_LOCATION}/dumps/${SERVICE_NAME}/${ENV_TYPE}/$ts/${POD_NAME}; mkdir -p $loc; sleep 1; echo $ts > $loc/restart; @@ -115,25 +107,7 @@ USAGE: {{- $ := .ctx }} {{- $javaAdvancedFlags := default "" $.Values.javaAdvancedFlags }} {{- $jfrDumpRootLocation := default "/opt/harness" $.Values.jfrDumpRootLocation }} -{{- $maxage := "12h" }} -{{- $jfcFilePath := "/opt/harness/profile.jfc" }} -{{- $maxchunksize := "20M" }} -{{- $memorysize := "20M" }} -{{- if hasKey $.Values "jfr" }} - {{- if hasKey $.Values.jfr "maxage" }} - {{- $maxage = $.Values.jfr.maxage }} - {{- end }} - {{- if hasKey $.Values.jfr "jfcFilePath" }} - {{- $jfcFilePath = $.Values.jfr.jfcFilePath }} - {{- end }} - {{- if hasKey $.Values.jfr "maxchunksize" }} - {{- $maxchunksize = $.Values.jfr.maxchunksize }} - {{- end }} - {{- if hasKey $.Values.jfr "memorysize" }} - {{- $memorysize = $.Values.jfr.memorysize }} - {{- end }} -{{- end }} -{{- $jfrFlags := printf "-Xms64M -XX:StartFlightRecording=disk=true,name=jfrRecording,maxage=%s,dumponexit=true,filename=%s/POD_NAME/jfr_dumponexit.jfr,settings=%s -XX:FlightRecorderOptions=maxchunksize=%s,memorysize=%s,repository=%s/POD_NAME --add-reads jdk.jfr=ALL-UNNAMED -Dotel.instrumentation.redisson.enabled=false" $maxage $jfrDumpRootLocation $jfcFilePath $maxchunksize $memorysize $jfrDumpRootLocation}} +{{- $jfrFlags := printf "-Xms64M -XX:StartFlightRecording=disk=true,name=jfrRecording,maxage=12h,dumponexit=true,filename=%s/POD_NAME/jfr_dumponexit.jfr,settings=/opt/harness/profile.jfc -XX:FlightRecorderOptions=maxchunksize=20M,memorysize=20M,repository=%s/POD_NAME --add-reads jdk.jfr=ALL-UNNAMED -Dotel.instrumentation.redisson.enabled=false" $jfrDumpRootLocation $jfrDumpRootLocation}} {{- if $.Values.global.jfr.enabled }} {{- $javaAdvancedFlags = printf "%s %s" $javaAdvancedFlags $jfrFlags }} {{- end }} From e20e5577c0566bc826c9c8e2d531a3b718313535 Mon Sep 17 00:00:00 2001 From: siraj-io <103127931+siraj-io@users.noreply.github.com> Date: Mon, 18 Nov 2024 17:05:18 +0530 Subject: [PATCH 2/2] Update Chart.yaml --- src/common/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/Chart.yaml b/src/common/Chart.yaml index f3860fe..798e32d 100644 --- a/src/common/Chart.yaml +++ b/src/common/Chart.yaml @@ -15,7 +15,7 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.69 +version: 1.3.71 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to