refactor(ndm): drop the loopback ping detection #60790
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 277 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.337
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #60790"
general
weight: 0.35
Pierre-L42
What does this PR do?
Removes the loopback ping that discovery and the connectivity check used to decide whether ping works. The socket type now comes from the OS (raw on Windows, UDP elsewhere), with the request's Linux
use_raw_socketoverride, throughpingprobe.ResolveRawSocket, which both components now share. A ping that fails is reported as it always was.Functional changes
| Before | After |
| --- | --- |
| Discovery, the loopback ping at startup fails: ping is dropped from every range until the agent restarts | Ping runs for every range that asks for it |
| Connectivity check on Windows, the first loopback ping fails: every later ping fails with "udp socket cannot be used with this OS" | Pings use a raw socket regardless |
| Discovery range with
linux.use_raw_socket: true: ignored, ping stays on the UDP socket | Honoured: ping goes through system-probe's ping module, like the SNMP check || Every agent start with discovery enabled, and the first connectivity check: one loopback ping, waiting up to a second | No ping until a probe runs |
Unchanged: a failed ping is still
unreachable, the payloads and the PAR result shape are the same, and SNMP is untouched.Motivation
A loopback ping is a poor proxy for "can this agent ping devices". It fails on hosts that ignore echo requests (
icmp_echo_ignore_all) but can ping devices fine, and on Linux it never tried the raw socket path through system-probe. Because it ran once, one transient failure at startup also disabled ping in discovery for the agent's lifetime.Describe how you validated your changes
Unit tests cover the per-OS socket defaults and the Linux override, in
pingprobeand in both components' option parsing.pingprobeand its test build for Windows.Additional Notes
On a host that can't send pings at all, ping now reads
unreachablefor every device instead of being skipped. Telling the two apart needs a way to classify a ping the agent couldn't send, which was tried on this branch and dropped: an error-code list missed cases, and classifying by stage misread system-probe HTTP timeouts on long raw-socket pings.🤖 Generated with Claude Code