fix(telemetry): more phase-7 review fixes

- ValidationTracker: remove dead hard-trim Pass 1. The preceding
  eviction loop already erases every reconciled entry older than the
  late-repair cutoff using the same condition, so Pass 1 could never
  match. The "drop any reconciled entry" fallback is retained.
- integration-test.sh: probe the StatsD port with a UDP-aware check
  (ss -ulnp) instead of curl. StatsD is UDP-only on 8125, so the TCP
  curl probe always reported "refused" — a false negative. Guarded by
  a command -v ss check that logs a skip when ss is unavailable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-07-07 16:55:19 +01:00
parent ab0d8249fd
commit 04f351f3b7
2 changed files with 11 additions and 21 deletions

View File

@@ -580,11 +580,15 @@ check_otel_metric "rippled_total_Bytes_In"
# Verify StatsD receiver is NOT required (no statsd receiver in pipeline)
log ""
log "--- Verify StatsD receiver is not required ---"
statsd_port_check=$(curl -sf "http://localhost:8125" 2>&1 || echo "refused")
if echo "$statsd_port_check" | grep -qi "refused\|error\|connection"; then
ok "StatsD port 8125 is not listening (not required)"
# StatsD listens on UDP 8125, so probe with a UDP-aware tool, not curl (TCP).
if command -v ss >/dev/null 2>&1; then
if ss -ulnp 2>/dev/null | grep -q ":8125"; then
fail "StatsD port 8125 appears to be listening (should not be needed)"
else
ok "StatsD port 8125 is not listening (not required)"
fi
else
fail "StatsD port 8125 appears to be listening (should not be needed)"
log "ss not found -- skipping StatsD UDP port check"
fi
# ---------------------------------------------------------------------------

View File

@@ -126,25 +126,11 @@ ValidationTracker::evictOldPending(TimePoint now)
}
}
// Hard trim if still over limit -- remove reconciled entries that are
// past the late-repair window first, then any reconciled entry as a
// last resort.
// Hard trim if still over limit. The loop above already removed every
// reconciled entry older than the late-repair window, so here we drop
// any remaining reconciled entry as a last resort.
if (pending_.size() > kMaxPendingEvents)
{
// Pass 1: only entries past late-repair window.
for (auto it = pending_.begin();
it != pending_.end() && pending_.size() > kMaxPendingEvents;)
{
if (it->second.reconciled && it->second.recordTime < cutoff)
{
it = pending_.erase(it);
}
else
{
++it;
}
}
// Pass 2: any reconciled entry if still over limit.
for (auto it = pending_.begin();
it != pending_.end() && pending_.size() > kMaxPendingEvents;)
{