| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #1827 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 33 33
Lines 3799 3839 +40
Branches 543 553 +10
=======================================
+ Hits 3792 3832 +40
Misses 5 5
Partials 2 2 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
Merging this PR will not alter performance✅ 24 untouched benchmarks Comparing nsec_address_denial (0ffc2ed) with master (ca9d027) |
Sorry, something went wrong.
There was a problem hiding this comment.
Adds NSEC-based fast failure when required address families are authoritatively unavailable.
Changes:
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/zeroconf/_services/info.py | Implements address-family denial handling. |
| src/zeroconf/_services/info.pxd | Adds corresponding Cython declarations. |
| tests/services/test_info.py | Tests cached, live, partial, and reset behavior. |
src/zeroconf/_services/info.py:675
if _TYPE_A not in rdtypes and not self._ipv4_denied:
self._ipv4_denied = True
updated = True
if _TYPE_AAAA not in rdtypes and not self._ipv6_denied:
self._ipv6_denied = True
updated = True
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
|
Previous review — superseded by a newer review below. |
Sorry, something went wrong.
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
Sorry, something went wrong.
ServiceInfo is a single shot throw away |
Sorry, something went wrong.
Agreed, dropping that one. Flags reset at top of _load_from_cache, so each request re-derives from cache. Stale window bounded by NSEC TTL. Address guard in _is_denied covers cached-address case. |
Sorry, something went wrong.
|
Previous review — superseded by a newer review below. |
Sorry, something went wrong.
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
Sorry, something went wrong.
PR Review — fix: fail service resolution fast when nsec denies the needed address typesBoth outstanding suggestions from the last round are now covered by tests, and no production code changed since — approving with two cosmetic nits. Specific things done well:
🟢 Suggestions1. [Pre-Existing Issue] `@cython.locals` for `async_update_records` names locals that don't existsrc/zeroconf/_services/info.pxd:85 The cython.locals list on this line declares update=bint and cache=DNSCache, but async_update_records has neither local — the accumulator is named updated (src/zeroconf/_services/info.py:576) and there is no cache binding in that method at all. Why it matters: the intended effect of update=bint was to give the accumulator a C-level bint so updated |= self._process_record_threadsafe(...) compiles to a C or instead of a Python bitwise-or on bool objects. With the name misspelled, Cython silently declares two unused C locals and updated stays a Python object — the annotation is doing nothing on a path the PR description explicitly calls out as perf-sensitive. This predates the PR, but the line is being edited here anyway (to add record and nsec_records), so renaming update -> updated and dropping the dead cache entry is a one-token fix that finally delivers the typing that was intended. @cython.locals(record_update=RecordUpdate, record=DNSRecord, update=bint, cache=DNSCache, nsec_records=list)
cpdef void async_update_records(self, object zc, double now, cython.list records)
tests/services/test_info.py:3010-3014 CLAUDE.md is explicit about this shape: "Test docstrings retelling the production-side story. A test docstring should name what the test pins, in one sentence — not re-explain the bug, the fix, or the surrounding flow." The summary line already names what is pinned; the two-line body re-explains the legacy inverted-bitmap behaviour and the _is_denied invariant, which is PR-description material. Every other new test in this batch is a single line and reads well. Dropping the body (or folding the essential half-clause into the summary) brings it in line with the rest of the file. """A pre-0.150.4 inverted NSEC from a service with server == name never denies the request.
Legacy responders listed the missing address types, so the snapshot records
the wrong family; a single wrong flag must never make _is_denied true.
"""
Checklist
Automated review by Kōan (Claude) HEAD=ac3afd2 4 min 55s |
Sorry, something went wrong.
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
Sorry, something went wrong.
|
Addressed both nits in 0ffc2ed. For the cython.locals one, the suggested updated=bint does not compile; the body already annotates updated: bool = False, so Cython errors with 'updated' redeclared. That annotation already produces a C bint (int __pyx_v_updated in the generated C), so I dropped the dead update and cache entries instead. The test docstring is now a single line. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Follow up to #1825. When an NSEC record at the host name denies every address type a request still needs, async_request now fails fast instead of waiting out the full timeout; RFC 6762 §6.1 makes such an NSEC an authoritative nonexistence assertion.
Details
Test plan