Skip to content

HANA_CALL - show {output,suErr,cmdErr} in any error case, not only for RC=1  #247

@PeterPitterling

Description

@PeterPitterling

SAPHanaSR/ra/SAPHana

Lines 679 to 691 in 8db3d75

output=$(if [ -f "$cmd_out_log" ]; then cat "$cmd_out_log"; rm -f "$cmd_out_log"; fi)
suErr=$(if [ -f "$su_err_log" ]; then cat "$su_err_log"; rm -f "$su_err_log"; else echo "NA"; fi)
cmdErr=$(if [ -f "$cmd_err_log" ]; then cat "$cmd_err_log"; rm -f "$cmd_err_log"; else echo "NA"; fi)
super_ocf_log debug "DBG: RA ==== action HANA_CALL (cmd is '$cmd', rc is '$rc', stderr from su is '$suErr', stderr from cmd is '$cmdErr') ===="
# on rc=1 - retry to improve the behavior in AD environments
if [ $rc -eq 1 ]; then
super_ocf_log warn "RA: HANA_CALL stderr from command '$pre_cmd' is '$suErr', stderr from command '$cmd' is '$cmdErr'"
if [ "$cmdErr" == "NA" ]; then
# seems something was going wrong with the 'pre_cmd' (su)
super_ocf_log warn "DEC: HANA_CALL returned '1' for command '$pre_cmd'. Retry once."
output=$(timeout --foreground -s 9 "$timeOut" $pre_cmd "$pre_script; timeout -s 9 $timeOut $cmd"); rc=$?
fi
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions