fix(monitoring): fix ladder bash syntax and soft-skip confirm
This commit is contained in:
parent
376f15d702
commit
c591bd9076
1 changed files with 13 additions and 19 deletions
|
|
@ -338,7 +338,7 @@ for AMT in "$@"; do
|
||||||
# Server-side auto-confirm only watches landing withdraw-watch.ids — ladder must confirm itself.
|
# Server-side auto-confirm only watches landing withdraw-watch.ids — ladder must confirm itself.
|
||||||
bank_st() {
|
bank_st() {
|
||||||
curl -sS -m 8 "${BANK}/taler-integration/withdrawal-operation/${WID}" 2>/dev/null \
|
curl -sS -m 8 "${BANK}/taler-integration/withdrawal-operation/${WID}" 2>/dev/null \
|
||||||
| python3 -c 'import json,sys; print(json.load(sys.stdin).get("status",""))' 2>/dev/null || true
|
| python3 -c 'import json,sys; print((json.load(sys.stdin).get("status") or "").strip())' 2>/dev/null || true
|
||||||
}
|
}
|
||||||
do_confirm() {
|
do_confirm() {
|
||||||
curl -sS -m 15 -o "$SCRATCH/conf-$tag.json" -w '%{http_code}' -X POST \
|
curl -sS -m 15 -o "$SCRATCH/conf-$tag.json" -w '%{http_code}' -X POST \
|
||||||
|
|
@ -416,8 +416,12 @@ else:
|
||||||
"${BANK}/taler-integration/withdrawal-operation/${WID}" 2>/dev/null || echo "000")
|
"${BANK}/taler-integration/withdrawal-operation/${WID}" 2>/dev/null || echo "000")
|
||||||
info "force-select" "HTTP ${code_fs} rpub=${rpub:0:12}…"
|
info "force-select" "HTTP ${code_fs} rpub=${rpub:0:12}…"
|
||||||
else
|
else
|
||||||
|
_rpub_empty=no
|
||||||
|
[ -z "$rpub" ] && _rpub_empty=yes
|
||||||
|
_epayto_empty=no
|
||||||
|
[ -z "$epayto" ] && _epayto_empty=yes
|
||||||
warn bank "force-select skipped" \
|
warn bank "force-select skipped" \
|
||||||
"problem: missing reserve_pub or exchange payto (rpub_empty=$( [ -z "$rpub" ] && echo yes || echo no ); cannot move bank status pending→selected)"
|
"problem: cannot move bank pending->selected (reserve_pub empty=${_rpub_empty}, exchange payto empty=${_epayto_empty})"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -457,26 +461,16 @@ else:
|
||||||
sleep 0.4
|
sleep 0.4
|
||||||
done
|
done
|
||||||
ms_confirm=$(elapsed_ms "$t0")
|
ms_confirm=$(elapsed_ms "$t0")
|
||||||
|
st=$(printf '%s' "${st:-}" | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
if [ "$conf_ok" != "1" ]; then
|
if [ "$conf_ok" != "1" ]; then
|
||||||
note="${note:-confirm timeout last=${st:-empty}}"
|
note="${note:-confirm timeout last=${st:-empty}}"
|
||||||
# Soft: stuck pending is often force-select/rpub or bank lag — do not kill whole ladder
|
# Soft: not confirmed after polls — WARN and continue (pending/select lag or force-select issues)
|
||||||
if [ "${st:-}" = "pending" ] || [ -z "${st:-}" ]; then
|
status="SKIP_CONFIRM"
|
||||||
status="SKIP_CONFIRM"
|
warn bank "confirm $AMT skipped" \
|
||||||
warn bank "confirm $AMT skipped" \
|
"problem: bank status='${st:-empty}' after ${LADDER_CONFIRM_POLLS} polls (want selected/confirmed); ladder continues. detail: $note"
|
||||||
"problem: bank withdrawal stayed '${st:-empty}' (not selected) after ${LADDER_CONFIRM_POLLS} polls — reserve may not have been attached; ladder continues. detail: $note"
|
|
||||||
ms_total=$(elapsed_ms "$t_rung")
|
|
||||||
echo -e "${rung}\t${range_note}\t${AMT}\t${status}\t${ms_mint}\t${ms_accept}\t${ms_confirm}\t${ms_settle}\t${ms_total}\t${WID}\t${note}" >>"$TSV"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
err bank "confirm $AMT" "$note"
|
|
||||||
status="FAIL_CONFIRM"
|
|
||||||
STOP_REASON="$note"
|
|
||||||
STOP_AMOUNT="$AMT"
|
|
||||||
ms_total=$(elapsed_ms "$t_rung")
|
ms_total=$(elapsed_ms "$t_rung")
|
||||||
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \
|
echo -e "${rung}\t${range_note}\t${AMT}\t${status}\t${ms_mint}\t${ms_accept}\t${ms_confirm}\t${ms_settle}\t${ms_total}\t${WID}\t${note}" >>"$TSV"
|
||||||
"$rung" "$range_note" "$AMT" "$status" "$ms_mint" "$ms_accept" "$ms_confirm" "$ms_settle" "$ms_total" "$WID" "$note" >>"$TSV"
|
continue
|
||||||
FAIL_N_L=$((FAIL_N_L + 1))
|
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
ok "confirm $AMT ${ms_confirm}ms (client, on selected)"
|
ok "confirm $AMT ${ms_confirm}ms (client, on selected)"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue