Skip to content

feat: avoid waking async_request when record updates are not relevant#1153

Merged
bdraco merged 36 commits into
masterfrom
records
Apr 3, 2023
Merged

feat: avoid waking async_request when record updates are not relevant#1153
bdraco merged 36 commits into
masterfrom
records

Conversation

@bdraco

@bdraco bdraco commented Apr 3, 2023

Copy link
Copy Markdown
Member

Because zc.async_wait() was used, every incoming packet would wake up async_request even if there were not changes.

@codecov

codecov Bot commented Apr 3, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (41ea06a) 99.77% compared to head (fc5a986) 99.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1153   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files          22       22           
  Lines        2646     2654    +8     
  Branches      461      463    +2     
=======================================
+ Hits         2640     2648    +8     
  Misses          4        4           
  Partials        2        2           
Impacted Files Coverage Δ
src/zeroconf/__init__.py 100.00% <100.00%> (ø)
src/zeroconf/_services/info.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment thread src/zeroconf/_services/info.py Outdated
Comment thread src/zeroconf/_services/info.py Outdated
@bdraco

bdraco commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

This should fix all the races with ip address ordering

@bdraco

bdraco commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

I think we are missing coverage for a few of these races.

We also didn't handle server name changing before correctly

@bdraco

bdraco commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

Going to need to split this into two PRs

One to fix the races with the server name changing

  • needs test for that
  • needs test for ipv6 address seen last is first
  • needs test for invalid dnsaddress in cache

One to avoid the awake on every packet

@bdraco

bdraco commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

There is another bug here

self.server needs to start out set to None as well as server_key.

Otherwise we could have addresses in the cache for the ptr name but it actually uses a different name in the dev record and a different address so we end up returning the addresses for the ptr name instead of the srv

Everything that returns self.server might need to be adjusted as well

@bdraco

bdraco commented Apr 3, 2023

Copy link
Copy Markdown
Member Author

Still need a test for the server changing via a DNSService update

Need to start off with the original name and than change it

@bdraco bdraco marked this pull request as ready for review April 3, 2023 21:09
@bdraco bdraco merged commit a3f970c into master Apr 3, 2023
@bdraco bdraco deleted the records branch April 3, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant