diff --git a/docker/telemetry/integration-test.sh b/docker/telemetry/integration-test.sh index 2c9b1f49af..3e9ac410f2 100755 --- a/docker/telemetry/integration-test.sh +++ b/docker/telemetry/integration-test.sh @@ -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 # --------------------------------------------------------------------------- diff --git a/src/xrpld/telemetry/detail/ValidationTracker.cpp b/src/xrpld/telemetry/detail/ValidationTracker.cpp index 38e065d8b5..17ec00fde3 100644 --- a/src/xrpld/telemetry/detail/ValidationTracker.cpp +++ b/src/xrpld/telemetry/detail/ValidationTracker.cpp @@ -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;) {