Catch alternating errors on MacOS/BSD#47
Open
AivanF wants to merge 1 commit into
Open
Conversation
On MacOS (and other BSDs), when the local network is down `ping`
emits a `ping: sendto: <reason>` line on stderr immediately, then
the matching `Request timeout for icmp_seq N` once it gives up —
one pair per failed packet. The timeout line is already accounted
for as a lost packet, but each `sendto` line falls through to the
generic "other line" handler and clutters the output:
- the 1:1 interleaving with `Request timeout` breaks the existing
"Last message repeated N times" dedup,
- different sendto reasons ("Network is down", "No route to host",
"Host is down", ...) count as distinct lines and each gets
printed at least once,
- every such line triggers `other_line_is_printed()`, which moves
the cursor past the stats and disrupts the live dots layout.
This adds an early branch in the awk main loop that silently drops
lines matching `^ping: send(to|msg): /`, mirroring the existing
filters for blank lines and httping's `error shutting down ssl`
noise. Packet-loss accounting is unchanged: the matching
`Request timeout` still increments the counters and prints `!`.
Linux's iputils `ping` does not emit `ping: sendto:` / `sendmsg:`
prefixed lines during the steady-state ping loop, so this is a
no-op there. `mockping.sh` has been extended with an interleaved
sendto/timeout block plus a recovery ping to exercise the path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On MacOS (and other BSDs), when the local network is down
pingemits aping: sendto: <reason>line on stderr immediately, then the matchingRequest timeout for icmp_seq Nonce it gives up — one pair per failed packet. The timeout line is already accounted for as a lost packet, but eachsendtoline falls through to the generic "other line" handler and clutters the output:Request timeoutbreaks the existing "Last message repeated N times" dedup,other_line_is_printed(), which moves the cursor past the stats and disrupts the live dots layout.This adds an early branch in the awk main loop that silently drops lines matching
^ping: send(to|msg): /, mirroring the existing filters for blank lines and httping'serror shutting down sslnoise. Packet-loss accounting is unchanged: the matchingRequest timeoutstill increments the counters and prints!.Linux's iputils
pingdoes not emitping: sendto:/sendmsg:prefixed lines during the steady-state ping loop, so this is a no-op there.mockping.shhas been extended with an interleaved sendto/timeout block plus a recovery ping to exercise the path.