• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dnsimple / erldns / 22856089477
87%

Build:
DEFAULT BRANCH: main
Ran 09 Mar 2026 01:38PM UTC
Jobs 1
Files 50
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Mar 2026 01:37PM UTC coverage: 86.653% (-0.4%) from 87.028%
22856089477

push

github

web-flow
Zone cache performance and correctness (#333)

* feat: add zone_name_existence and one-shot resolved lookups

- Add `zone_name_existence/2` returning exact | wildcard | ent |
  nxdomain in a single pass, with ENT blocking wildcard per RFC 4592.
- Add `get_records_by_name_resolved/2` and
  `get_records_by_name_and_type_resolved/3` returning ent | nxdomain |
  {exact, Records} | {wildcard, Records} so callers get both
  classification and records in one tree traversal.

How do the optimisations work:
- Replace `pattern_zone_dname_count` with `pattern_zone_dname_exists`
  (select limit 1) for existence checks. `pattern_zone_dname_exists`
  uses `ets:select/3` with limit 1 instead of `ets:select_count`. The
  engine stops after the first match, so a name with several types (e.g.
  A, AAAA, MX, TXT, RRSIG) is one ETS visit instead of counting all. The
  match spec uses `'_'` for the value so no record data is copied.
- Zone labels: reduce_record_labels_pre_reversed uses the zone’s
  reversed_labels (set at zone loading) so we no longer call
  lists:reverse(ZoneLabels) on every lookup; only the query's labels are
  reversed.
- Single-pass existence: zone_name_existence_1 does one traversal (exact
  then ENT then optional wildcard climb) and returns a single
  classification. The old code could do two full traversals (e.g.
  `is_record_name_in_zone` then `is_record_name_in_zone_strict` for
  ENT/NXDOMAIN). ENT now costs 2 ETS calls; NXDOMAIN 2+2N instead of
  4+4N. The wildcard climb uses one recursive function and
  lists:reverse/2 to build the wildcard path in one go instead of
  droplast + append; parent is O(1) by dropping the head of the reversed
  path.

* Optimise erldns_dnssec pipe

Use better functions from erldns_zone_cache and reduce redundant domain
handling by reusing already normalised and split information stored in
the pipe options.

* Optimise erldns_resolver pipe

Use better functions from erldns_zone_cache

* Use first instead of last wher... (continued)

126 of 130 new or added lines in 4 files covered. (96.92%)

12 existing lines in 4 files now uncovered.

1714 of 1978 relevant lines covered (86.65%)

1431.49 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
97.31
-0.02% src/zones/erldns_zone_cache.erl
3
77.36
-4.99% src/pipes/erldns_resolver.erl

Uncovered Existing Lines

Lines Coverage ∆ File
1
84.42
-1.3% src/listeners/udp/erldns_proto_udp.erl
1
97.5
-0.3% src/pipes/erldns_dnssec.erl
2
81.48
-7.41% src/pipes/erldns_edns_ede.erl
8
77.36
-4.99% src/pipes/erldns_resolver.erl
Jobs
ID Job ID Ran Files Coverage
1 22856089477.1 09 Mar 2026 01:38PM UTC 50
86.65
GitHub Action Run
Source Files on build 22856089477
  • Tree
  • List 50
  • Changed 8
  • Source Changed 5
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22856089477
  • e7a7a384 on github
  • Prev Build on main (#22354907527)
  • Next Build on main (#22901787809)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc