Repository navigation
fix(feeders): degrade on recent lossy lines, match host-only DNS failures (#375, #376) - #403
Merged
Merged
Conversation
…ures readsb's lossy-line N is a lifetime share of the connection; a current rate cannot be derived from its lines (net_io.c:1530-1551 at bc57f2dd), so none is published. The feed now reads degraded while connected when two lossy lines of the current connection fall within 15 min, or when the newest is recent and its N rose over the previous one's. The 1.0% threshold is gone; detail.adsb_out_lossy_lines_recent is added next to the lifetime adsb_out_loss_pct (#375). "Name resolution for <host> failed" names no port; it is now matched by host for every configured feed on that host and classed closed. Known benign readsb notes (Ignoring this DNS reply, Attempting connection, TCP_NODELAY/keepalive) are ignored without a warning (#376). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFZvpNYnicPHv6pjHTVK2f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFZvpNYnicPHv6pjHTVK2f
…S reply is closed Review of #403. serviceConnect runs only for a connector that is not connected (net_io.c:740, :755) and a failed resolve returns before any socket exists (:626-633), so a host-only "Name resolution … failed" line never describes a feed held as established: it no longer replaces an established state, held or set earlier in the same read. "Ignoring this DNS reply" (:662-672) abandons the connect attempt and names host and port; it is now closed, not benign, so a feed sinkholed to 0.0.0.0 reads down instead of unknown for ever. Also: qualify the first-10-s rule by the debug flags (:1534), cite pthread_create ERROR at :598, mark the slice-127 ADR paragraph superseded, test a rise over a lossy line outside the window, cite #406. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFZvpNYnicPHv6pjHTVK2f
# Conflicts: # planning/roadmap.yaml
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.
Summary
Slice 140 covers issues #375 and #376. Both are follow-ups of slice 127 (#372) in
feeders/ultrafeeder.py.What readsb does (net_io.c, wiedehopf/readsb
bc57f2ddd83016e5628f63012eea1a51155623a5)dropHalfUntil(:1530-1551)N = 100 - bytesSent/bytesFromWriter*100and prints it with%4.1f. Both counters are per client and start at zero when the connection opens.now > dropHalfAntiSpamand then pushes that time 300 s ahead (10 s under--debug net, 2 s under--debug flush).--debug net/--debug flush, it never prints in a connection's first 10 s (:1534).Name resolution for %s failed: %s(:626-633)silent_failis set. The connect-error suppression does not apply to it.serviceConnectruns only for a connector that is not connected (:740, :755). A failed resolve returns before any socket exists.<host> port <n>: Ignoring this DNS reply: 0.0.0.0|::(:662-672)Attempting connection to …(:684,--debug netonly).setSockopts'sUnable to set TCP_NODELAY/Unable to set keepalive(:277, :284).Binding rulings, and how they are implemented
No numeric "current %". None is published. The module docstring, API.md and the ADR say why: the bytes offered between two lines are not logged, and at
%4.1fa two-second half-drop on a connection older than about half an hour does not move N at all.adsb_out_loss_pctstays the lifetime figure.detail.adsb_out_lossy_lines_recentis new: the number of the current connection's lossy lines withinLOSSY_RECENT_MS(15 min).When the feed reads degraded. While the connection is up, the feed is
degradedwhen either holds:LOSSY_RECENT_MS(LOSSY_RECENT_LINES = 2);LOSSY_DEGRADED_PCTis removed. Messages:Both reasons are joined when both hold.
The rise rule also requires the newest lossy line to be within
LOSSY_RECENT_MS(endorsed in review). The previous lossy line may be older than the window.Host-only DNS line (Feeders: readsb lines without a port are never matched (DNS failure) or warn forever (Ignoring this DNS reply) #376).
beast_line_matcheralso selectsName resolution for <host> failed:by exact host. That covers every feed configured on that host and no other host;adsbexchange.comdoes not matchfeed.adsbexchange.com.classify_beast_lineclasses the lineclosed.establishedstate, whether held from an earlier read or set earlier in the same read, because it can only be a sibling connector's. It closes a feed whose state is unknown or already closed."Ignoring this DNS reply" is
closed(review fix). It names host and port and abandons the attempt. A feed sinkholed to 0.0.0.0 logs nothing else, so asbenignit would read unknown for ever.Benign lines (Feeders: readsb lines without a port are never matched (DNS failure) or warn forever (Ignoring this DNS reply) #376). A new
benignkind covers "Attempting connection" and the TCP_NODELAY / keepalive notes. These lines are skipped without a warning and never move the state.Other changes
Out of scope
The
"port {n}"/host in linesubstring matching is tracked as #406.Docs
docs/API.mdfeeder section.readsb_beast_lines.tsv, extended and cited by line number:closed;benignrows;unrecognisedrow is nowpthread_create ERROR(:598).Tests
New or rewritten tests in
tests/feeders/test_vendors.py:The fixture-parametrized classification test covers all new rows. The reference-install (#369) replay still reads
up.Run locally:
uv run pytest tests/feeders -q --no-cov: 218 passeduv run ruff check .: cleanuv run ruff format --check .: cleanuv run mypy: no issues (582 files)Closes #375
Closes #376
🤖 Generated with Claude Code
https://claude.ai/code/session_01JFZvpNYnicPHv6pjHTVK2f