Skip to content

Efficiently bucket queries with known answers#698

Merged
bdraco merged 3 commits into
python-zeroconf:masterfrom
bdraco:bucket_queries
Jun 17, 2021
Merged

Efficiently bucket queries with known answers#698
bdraco merged 3 commits into
python-zeroconf:masterfrom
bdraco:bucket_queries

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Jun 17, 2021

  • Aggregate queries so that as many known answers as possible fit in the same packet
    without having known answers spill over into the next packet unless the
    question and known answers are always going to exceed the packet size.

  • Some responders do not implement multi-packet known answer suppression
    so we try to keep all the known answers in the same packet as the
    questions.

  • Basic design is extensible to other record types besides PTR, however
    we currently don't need to support any other record types.

Fixes #691

- Aggregate queries so that as many known answers as possible fit in the same packet
  without having known answers spill over into the next packet unless the
  question and known answers are always going to exceed the packet size.

- Some responders do not implement multi-packet known answer suppression
  so we try to keep all the known answers in the same packet as the
  questions.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 17, 2021

Codecov Report

Merging #698 (57d0f3f) into master (26fa2fb) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #698      +/-   ##
==========================================
+ Coverage   98.15%   98.23%   +0.07%     
==========================================
  Files          17       17              
  Lines        2118     2153      +35     
  Branches      372      376       +4     
==========================================
+ Hits         2079     2115      +36     
  Misses         23       23              
+ Partials       16       15       -1     
Impacted Files Coverage Δ
zeroconf/_dns.py 100.00% <100.00%> (ø)
zeroconf/_services/__init__.py 96.82% <100.00%> (+0.42%) ⬆️
zeroconf/aio.py 99.39% <100.00%> (ø)
zeroconf/const.py 97.43% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26fa2fb...57d0f3f. Read the comment docs.

@bdraco
Copy link
Copy Markdown
Member Author

bdraco commented Jun 17, 2021

Moved this to production testing and right away all the truncated queries are gone except for _hap which is expected since > 41 records

@bdraco bdraco merged commit 7e30848 into python-zeroconf:master Jun 17, 2021
@bdraco bdraco deleted the bucket_queries branch June 17, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a DNSQueryBuilder to solve sending queries with more than one question where the known answers don't fit

2 participants