Skip to content
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

HPCC-30413 Add option to always capture post-mortem info #17853

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion helm/hpcc/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,12 @@ Add extra args for a component
{{- $debugPlane := .me.debugPlane | default (include "hpcc.getFirstPlaneForCategory" (dict "root" .root "category" "debug")) -}}
{{- include "hpcc.checkPlaneExists" (dict "root" .root "planeName" $debugPlane) -}}
{{- $prefix := include "hpcc.getPlanePrefix" (dict "root" .root "planeName" $debugPlane) -}}
{{- $meExpert := .me.expert | default dict -}}
{{- $globalExpert := .root.Values.global.expert | default dict -}}
{{- $alwaysPostMortem := (hasKey $meExpert "alwaysPostMortem") | ternary $meExpert.alwaysPostMortem ($globalExpert.alwaysPostMortem | default false) -}}
{{- if $alwaysPostMortem -}}
"-a",{{ "\n" }}
{{- end -}}
"-d", {{ $prefix }},
"--",
{{ .process | quote }},
Expand Down Expand Up @@ -1670,7 +1676,14 @@ args:
{{- $debugPlane := .me.debugPlane | default (include "hpcc.getFirstPlaneForCategory" (dict "root" .root "category" "debug")) -}}
{{- include "hpcc.checkPlaneExists" (dict "root" .root "planeName" $debugPlane) -}}
{{- $prefix := include "hpcc.getPlanePrefix" (dict "root" .root "planeName" $debugPlane) -}}
{{- $_ := set $check_cmd "command" (printf "check_executes -d %s -- %s" $prefix .command) -}}
{{- $pmd_always_opt := "" -}}
{{- $globalExpert := .root.Values.global.expert | default dict -}}
{{- $meExpert := .me.expert | default dict -}}
{{- $alwaysPostMortem := (hasKey $meExpert "alwaysPostMortem") | ternary $meExpert.alwaysPostMortem ($globalExpert.alwaysPostMortem | default false) -}}
{{- if $alwaysPostMortem -}}
{{- $pmd_always_opt = "-a " -}}
{{- end -}}
{{- $_ := set $check_cmd "command" (printf "check_executes %s-d %s -- %s" $pmd_always_opt $prefix .command) -}}
{{- end }}
- >-
{{ $check_cmd.command }};
Expand Down
5 changes: 4 additions & 1 deletion initfiles/bin/check_executes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ PMD_PROGNAME=
PMD_COPYFILES=()
PMD_DALISERVER=
PMD_WORKUNIT=
PMD_ALWAYS=false

while [ "$#" -gt 0 ]; do
arg=$1
Expand All @@ -27,6 +28,8 @@ while [ "$#" -gt 0 ]; do
f) shift;
PMD_COPYFILES+=($1)
;;
a) PMD_ALWAYS=true
;;
*) usage
exit
;;
Expand Down Expand Up @@ -66,7 +69,7 @@ ${PMD_PROGNAME} --logging.postMortem=1000 "$@"

# If it did not exit cleanly, copy some post-mortem info
retVal=$?
if [ $retVal -ne 0 ]; then
if [ $PMD_ALWAYS = true ] || [ $retVal -ne 0 ]; then
POST_MORTEM_DIR=${PMD_DIRECTORYBASE}/$(hostname)/$(date -Iseconds)
mkdir -p ${POST_MORTEM_DIR}
echo "Post-mortem info gathered in $POST_MORTEM_DIR"
Expand Down
Loading